|
You're linking to a C library? Those are decorated C++ function names. Make sure if you're linking against a C library and you're compiling C++ files, you put extern "C" around the function declarations in the header file.
If it's all C++, then you must have an object file missing from the library, or the library is not being linked in correctly.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yes I am linking to a C library, but I'm also coding in C, there is no C++ involved at all it's all (99% sure) ANSI C code.
The GPIO routines which are causing the errors are pre-compiled in object files and I'm linking to them, I do have the source to the routines but because they're linking into the Linux kernel and various other parts of the system it's easier to use the .o files and it works when the source is in one file.
Ed
|
|
|
|
|
Ed.Poore wrote: Yes I am linking to a C library, but I'm also coding in C, there is no C++ involved at all it's all (99% sure) ANSI C code.
The compiler seems to think those functions are C++ functions. As I recall, GCC does not mangle C function names - only C++ function names. I would say that somewhere, your files are getting compiled as C++. I assume all the files have lowercase 'c' extensions - uppercase would cause them to be compiled as C++, and you're not compiling with the '-+' switch that forces C++ compilation.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I don't think that I've got an C++ options turned on, in fact it's the first thing I do when I do embedded stuff is turn on the ANSI C Compliance and turn off C++ stuff.
But then again maybe I missed something, anyhow I'll use the single source file at the moment as it works, flying out to Spain on Monday so I need something operational rather than tidy.
Thanks for the pointers though
Ed
|
|
|
|
|
Hi,
I hate to be bound to frameworks. I prefer simple DLL's that's easy to redistribute with the application. Hence I'd like to stay with C++ without all .net languages such as C#, VB nor Managed VC++.
Soon Microsoft will release Windows Vista... powered by the new programming API WinFX.
Is it worth studying any further Win32?
If not, would you please recommend a substitute api?
|
|
|
|
|
MS has backed away from the "everything new will be managed" direction. Vista will indeed have lots of new APIs and COM interfaces to play with. TaskDialog() is one that comes to mind.
In any event, you can't use the new W*F stuff (Avalon, and so on) without requiring Vista or XP SP2, and I for one am not going to do that to my users anytime soon.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Michael Dunn wrote: I for one am not going to do that to my users anytime soon.
And the crowd goes wild!!! I wouldn't either. I know tons of people who rip out XP and put W2K back on.
Love the Erica link! Top pic is the best! Wow!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Ed K wrote: know tons of people who rip out XP and put W2K back on.
i am one of them
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I only had to do that recently for a game from Activision that used the Intel Indeo ? audio and video drivers.
The drivers came built into Windows 2000 and were mysteriously absent from Windows XP.
Of course, you could download the drivers for $14 US to support XP, but the game only now costs about $5 if you can even find it anywhere anymore.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
MS has backed away from the "everything new will be managed" direction.
Kind of like when they backed away from the "everything new will be COM" direction ...
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Yes .................
There was a time when we worked on DOS .... and now after win2k and new versions of UNIX , what abt ......C and C++
It may me they will change some API , they also can make some new data type...
They can modify some api.... But .... it does not affect the core structure of win32..
Ashutosh
|
|
|
|
|
Go go Win32?
The fact that it's so old, and 'portable' (through Win :P), makes it very interesting.
|
|
|
|
|
I am tring to read 9869 rows from a input two files and write the differences between two files to an o/p file. My code was working with a sample file of 10 rows. But i get a debug assertion failed with the 9869 rows. I read the elements of the input files into a CArray. I see that this Array is getting emptied for some reason. could you please help me with this?
-- modified at 18:01 Wednesday 15th February, 2006
|
|
|
|
|
cuteee wrote: I see that this Array is getting emptied for some reason. could you please help me with this?
For some unexplained reason, I'm unable to get access to your computer. Can you please post a code snippet that exhibits the problem? How are you populating the CArray object? What happens right after that?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I have been using a simple routine to wait while connected hardware is performing a reset, ...
The routine is:
<br />
DWORD stop_time = GetTickCount() + iCount;<br />
while ((long)(GetTickCount() - stop_time) < 0L){<br />
MSG msg;<br />
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
}<br />
Someone has complained that the task manager in XP is showing that the CPU usage goes to 100% during this wait period. Do I need to add a sleep in there or something else to prevent this?
|
|
|
|
|
Yes. PeekMessage does not wait for a message to appear on the message queue before returning.
Deus caritas est
|
|
|
|
|
Instead doing a busy wait try something like this:
UINT_PTR tid = SetTimer(NULL, 1, 5000, NULL);<br />
MSG m;<br />
while (GetMessage(&m, NULL, 0, 0))<br />
{<br />
TranslateMessage(&m);<br />
DispatchMessage(&m);<br />
<br />
if ( m.message==WM_TIMER && m.wParam==1 )<br />
{<br />
break;<br />
}<br />
}<br />
KillTimer(NULL, tid);
Steve
|
|
|
|
|
|
How do I go about starting this? Any help will be greatly appreciated.
Using the existing point class below, add overloaded operator methods
to perform the following:
1. Binary addition
2. Binary substraction
3. Binary multiplication
4. Binary division - division by zero should result in a point with
>coordinates (0,0) returned.
The overloaded operator method functions should perform under the
>following conditions:
1. point operator point; i.e. p+p, p-p, p*p, p/p
2. point operator int; i.e. p+i, p-i, p*i, p/i
3. int operator point; i.e. i+p, i-p, i*p, i/p
Point Class
//Class Point
//File: Point.h
#ifndef _POINT_H_
#define _POINT_H_
using namespace std;
class point
{
private:
int _x;
int _y;
public:
point() //default constructor
}
_x=0;
_y=0;
}
point(int x, int y)
{
_x=x;
_y=y;
}
~point() //destructor
{}
void print();
void set(int,int);
};
#endif
>/*-------------------------------Point.cpp-------------------------*/
// Class Point Member Definitions
// File: Point.cpp
#include <iostream>
#include "point.h"
void point::print()
{
cout << "Point (" << _x << "," << _y << ")\n";
}
void point::set(int x, int y)
{
_x = x;
_y = y;
}
>/*---------------- TestPoint.cpp ------------------------*/
// Class Point Test Program
// File: TestPoint.cpp
#include <iostream>
#include "point.h"
using namespace std;
void main (void)
{
point p1;
point p2(5,6);
point p3;
int x;
int y;
cout << "Input p3 x coordinate: ";
cin >> x;
cout << "Input p3 y coordinate: ";
cin >> y;
p3.set(x,y);
p1.print();
p2.print();
p3.print();
|
|
|
|
|
homework ???
add these code in the class point...
class point
{
//old code.....
//
// my add constructor... int.
point(int single)
{
_x=single;
_y=single;
}
// overloaded operator methods ....
friend point operator +(const point& p1,const point& p2) {
return point(p1._x+p2._x , p1._y+p2._y);
}
friend point operator -(const point& p1,const point& p2) {
return point(p1._x-p2._x , p1._y-p2._y);
}
friend point operator *(const point& p1,const point& p2) {
return point(p1._x+p2._x , p1._y*p2._y);
}
friend point operator /(const point& p1,const point& p2) {
if (p2._x==0 || p2._y==0) return point(0 , 0);
else return point(p1._x/p2._x , p1._y/p2._y);
}
//~..
};
//then you can using like....
p3=p1+p2;
p3=p1-p2;
p3=p1*p2;
p3=p1+1;
p3=p1/100;
p3=p1/0;
..........
......
|
|
|
|
|
Hi
When I try to use these (FD_ACCEPT and FD_CONNECT) events In following function call:
WSAEventSelect(sock, event, FD_ACCEPT|FD_CONNECT|FD_WRITE ...),
the FD_CONNECT event can be gotten, but FD_ACCEPT and FD_WRITE can not be gotten.
What is the reason for this?
Thanks
|
|
|
|
|
When are you expecting the other two socket events to trigger your event handle? For example, the FD_WRITE event is not "fired" when you write on the socket, but if you fail to do a non-blocking send on a socket AND then when the socket gets to a state where the write would be able to complete successfully.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hello all,
This should be easy but for some reason I am having troubles... I am trying to create a simple 3 view split in a SDI... I want the split to look like an upside down T, so a Left Top Pane, Right Top Pane, and a Bottom Pane (The bottom Pane needs to go from one side of the frame to the other). Here is what I am trying...
if(!m_wndSplitter.CreateStatic(this, 2, 2))<br />
return FALSE;<br />
<br />
if(!m_BottomSplitter.CreateStatic(&m_wndSplitter, 1, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(1,1)))<br />
return FALSE;<br />
<br />
if( !m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(175, 175), pContext) ||<br />
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext))<br />
{<br />
m_wndSplitter.DestroyWindow();<br />
return FALSE;<br />
}<br />
<br />
if(!m_BottomSplitter.CreateView(0, 0, RUNTIME_CLASS(CBottomView), CSize(100, 100), pContext))<br />
{<br />
m_BottomSplitter.DestroyWindow();<br />
return FALSE;<br />
}
Any ideas?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Try this:
Assuming that you want a view layout like this:
The trick is basically creating your splitter window within the other in order to get the right layout.
The first splitter divides your window into two rows. Then using a second splitter, subdivide the upper row into two columns.. and viola
<br />
if(!m_wndSplitter.CreateStatic(this, 2, 1))<br />
return FALSE;<br />
<br />
if(!m_wndSplitterB.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(0,0)))<br />
return FALSE;<br />
<br />
if (!m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CBottomView),CSize(100, 100), pContext))<br />
{ <br />
TRACE0("Failed to create LeftView\n");<br />
return FALSE;<br />
}<br />
<br />
if (!m_wndSplitterB.CreateView(0, 0, RUNTIME_CLASS(CLeftView),CSize(100, 100), pContext))<br />
{ <br />
TRACE0("Failed to create LeftView\n");<br />
return FALSE;<br />
}<br />
<br />
if (!m_wndSplitterB.CreateView(0, 1, RUNTIME_CLASS(CRightView),CSize(100, 100), pContext))<br />
{ <br />
TRACE0("Failed to create LeftView\n");<br />
return FALSE;<br />
}
I Dream of Absolute Zero
|
|
|
|
|
RobJones wrote: Any ideas?
Yes. See the VIEWEX example on MSDN.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|