Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When trying to compile a plain C++

Status
Not open for further replies.

scecilia

Programmer
Jul 8, 2002
35
US
When trying to compile a plain C++ program (not visualC++) which uses DispatchMessage, TranslateMessage, and GetMessage in a DoEvents() loop function, I get the following link errors:

Butter2.obj : error LNK2001: unresolved external symbol __imp__DispatchMessageA@4
Butter2.obj : error LNK2001: unresolved external symbol __imp__TranslateMessage@4
Butter2.obj : error LNK2001: unresolved external symbol __imp__GetMessageA@16

Do you know if there is a library I can include to get these to work?
p.s In VisualC++ it works fine.
 
FYI, I found the answer.

DoEvents is just a function defined in a windows library, VC++ probably just automatically includes the library header, and link the library in when compiling/linking.

Outside VC++, I had to link User32.LIB.

Thanks,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top