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

Started by
6 comments, last by orlando2004 16 years, 10 months ago
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
Advertisement
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.
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?
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.
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?!?
Project menu -> Properties -> Configuration Properties -> Linker -> Input. Add the library files containing the definition for the functions in "Additional Dependencies".
Thank you Brother Bob, that worked. Why couldn't(wouldn't) it use the other directory entries?
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

This topic is closed to new replies.

Advertisement