API function won't compile using CYGWIN g++; Interpreting error message

R

Roger Sherman

I'm using CYGWIN g++. I'm having trouble making an API call the
WindowFromPoint function.
Here is my code.


FILE: t.cc
#include <windows.h>
int main () {

POINT p;
p.x=200;
p.y=200;

HWND window_handle;

window_handle = WindowFromPoint(p);

return 0;
}


Here is the error message I'm getting:

C:\DOCUME~1\jeff\LOCALS~1\Temp\ccIIB5F0.o(.text+0x22):t.cc: undefined
reference to 'WindowFromPoint@8'

Could someone please tell me
1)What this error means, specifically, and;

2)What I need to do to fix it

Thank you
Jeff
 
B

Barry Schwarz

I'm using CYGWIN g++. I'm having trouble making an API call the
WindowFromPoint function.
Here is my code.


FILE: t.cc
#include <windows.h>
int main () {

POINT p;
p.x=200;
p.y=200;

HWND window_handle;

window_handle = WindowFromPoint(p);

return 0;
}


Here is the error message I'm getting:

C:\DOCUME~1\jeff\LOCALS~1\Temp\ccIIB5F0.o(.text+0x22):t.cc: undefined
reference to 'WindowFromPoint@8'

Could someone please tell me
1)What this error means, specifically, and;

2)What I need to do to fix it

Thank you
Jeff
See the answers you get to the same question in
alt.comp.lang.learn.c-c++. If you must post to multiple groups, do it
with a single message, not an individual one to each group.


<<Remove the del for email>>
 
R

Régis Troadec

Hello,

Roger Sherman said:
I'm using CYGWIN g++. I'm having trouble making an API call the
WindowFromPoint function.
Here is my code.


FILE: t.cc
#include <windows.h>
int main () {

POINT p;
p.x=200;
p.y=200;

HWND window_handle;

window_handle = WindowFromPoint(p);

return 0;
}


Here is the error message I'm getting:

C:\DOCUME~1\jeff\LOCALS~1\Temp\ccIIB5F0.o(.text+0x22):t.cc: undefined
reference to 'WindowFromPoint@8'

Could someone please tell me
1)What this error means, specifically, and;

Although it's not a C problem as it's commonly discussed here, I *can* think
it's a linkage problem.
The linker can't resolve this name (WindowFromPoint) because you didn't
specify to your linker the library in which this function is stored.
2)What I need to do to fix it

You need to link your program with user32.lib

best regards, regis
 
C

CBFalconer

Roger said:
I'm using CYGWIN g++. I'm having trouble making an API call the
WindowFromPoint function.
Here is my code.

FILE: t.cc

sounds like a C++, not C program.
#include <windows.h>

definitely non-standard header.
int main () {

POINT p;

undefined type POINT
p.x=200;
p.y=200;

HWND window_handle;

Undefined type HWND. declaring variable after executable code.
window_handle = WindowFromPoint(p);

Undeclared function.
return 0;
}


Here is the error message I'm getting:

C:\DOCUME~1\jeff\LOCALS~1\Temp\ccIIB5F0.o(.text+0x22):t.cc: undefined
reference to 'WindowFromPoint@8'

Now we know you are using a C++ compiler. Off topic on c.l.c
Could someone please tell me
1)What this error means, specifically, and;

2)What I need to do to fix it

Get thee to a newsgroup where this is topical. The windows
contamination means c.l.c++ is not it. That, and the c++ code,
means c.l.c is not it. Maybe you should look for a group with the
word 'windows' in it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top