Sign in to follow this  

Problem with compiling code with Visual C++ Express 2005 on Windows Vista

This topic is 3871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can't figure out why I keep getting link errors with my program. I've added the necessary directories to the VC++ Directories. See the linker errors below. Creating library C:\Users\Matt\Documents\Visual Studio 2005\Projects\TurboCppDD\Release\TurboCppDD.lib and object C:\Users\Matt\Documents\Visual Studio 2005\Projects\TurboCppDD\Release\TurboCppDD.exp TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__TextOutA@20 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__DrawTextA@20 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _DirectSoundCreate@12 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__mciSendCommandA@16 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _DirectInputCreateEx@20 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _IID_IDirectInput7A TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _GUID_SysMouseEm TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _c_dfDIMouse TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _GUID_Joystick TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _c_dfDIJoystick TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _c_dfDIKeyboard TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__GetDC@4 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__GetDeviceCaps@8 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__ChangeDisplaySettingsA@8 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__GetWindowInfo@8 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__SetRect@20 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__CreateFontIndirectA@4 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__CreateScalableFontResourceA@16 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__AddFontResourceA@4 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__SelectObject@8 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__DeleteObject@4 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__RemoveFontResourceA@4 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__SetTextColor@8 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__SetBkColor@8 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__SetBkMode@8 TurboCppDD_Initialize.obj : error LNK2001: unresolved external symbol __imp__GetStockObject@4

Share this post


Link to post
Share on other sites
You haven't added the needed libraries to the linker settings. See the documentation for the function names it can't resolve (remove leading _ or __imp__ first) and see what library they belong to.

Share this post


Link to post
Share on other sites
Brother Bob: I've setup both include directories and the library directories in the tools->options->projects and solutions->VC++ directories.

Let me add some more information here, This program compiled fine with windows xp and the windows xp SDK. But I now have Windows Vista Home Premium, and the windows Vista SDK. I re-installed everything and set everything up the way I did on windows xp but with still no luck. Has anyone else had any problems with Windows Vista and Visual C++ Express?

Share this post


Link to post
Share on other sites
Quote:
Original post by mateo
Brother Bob: I've setup both include directories and the library directories in the tools->options->projects and solutions->VC++ directories.


Brother Bob's answer is correct. Adding directories is not enough - you have to tell VC++ what to look for in those directories! You should check what libraries contain the missing functions and add those libraries in the linker options.

Share this post


Link to post
Share on other sites
I've also added library names to the "corewin_express.vsprops", and added the library directories to the: Linker-> General -> Additional library directories. I can't think of any other place to define these directories!!
This is absolute bullshit, I tell it where to go multiple times and still gives me this shit!! What have I missed, where else can I define them?!?

Share this post


Link to post
Share on other sites
Project menu -> Properties -> Configuration Properties -> Linker -> Input. Add the library files containing the definition for the functions in "Additional Dependencies".

Share this post


Link to post
Share on other sites
Thank you Brother Bob, that worked. Why couldn't(wouldn't) it use the other directory entries?

Share this post


Link to post
Share on other sites
have to link it it wont look for it because that would be painfully slow esp if you take in the 3rd party api and sdk

Share this post


Link to post
Share on other sites
Sign in to follow this