| | |
linker errors in MSVC++ 2005
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2005
Posts: 62
Reputation:
Solved Threads: 0
hey im tryin to get this program me and my mates are writing to work, but for some reason i ge these errors upon compilation
im using MSVC++ Express Edition and ive downloaded PlatformSDK because it doesnt come standard with it.
im using MSVC++ Express Edition and ive downloaded PlatformSDK because it doesnt come standard with it.
C++ Syntax (Toggle Plain Text)
1>------ Build started: Project: av_bot, Configuration: Debug Win32 ------ 1>Compiling... 1>bot.cpp 1>Linking... 1>inputEmulation.obj : error LNK2019: unresolved external symbol __imp__SendInput@12 referenced in function "void __cdecl pressKey(int * const,int,int)" (?pressKey@@YAXQAHHH@Z) 1>inputEmulation.obj : error LNK2019: unresolved external symbol __imp__GetSystemMetrics@4 referenced in function "void __cdecl MouseMove(int,int)" (?MouseMove@@YAXHH@Z) 1>bot.obj : error LNK2001: unresolved external symbol __imp__GetSystemMetrics@4 1>bot.obj : error LNK2019: unresolved external symbol __imp__GetPixel@12 referenced in function "bool __cdecl compareColour(struct tagPOINT,struct myRGB)" (?compareColour@@YA_NUtagPOINT@@UmyRGB@@@Z) 1>bot.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "bool __cdecl compareColour(struct tagPOINT,struct myRGB)" (?compareColour@@YA_NUtagPOINT@@UmyRGB@@@Z) 1>bot.obj : error LNK2019: unresolved external symbol __imp__SetForegroundWindow@4 referenced in function _main 1>bot.obj : error LNK2019: unresolved external symbol __imp__FindWindowA@8 referenced in function "void __cdecl `dynamic initializer for 'windowHandle''(void)" (??__EwindowHandle@@YAXXZ) 1>C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\Project2\Debug\av_bot.exe : fatal error LNK1120: 6 unresolved externals 1>Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\Project2\Project2\Debug\BuildLog.htm" 1>av_bot - 8 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
•
•
Join Date: Oct 2005
Posts: 62
Reputation:
Solved Threads: 0
ok i got that working now i get this
C++ Syntax (Toggle Plain Text)
1>------ Build started: Project: av_bot, Configuration: Debug Win32 ------ 1>Compiling... 1>stdafx.cpp 1>Compiling... 1>bot.cpp 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.h(32) : error C2664: 'FindWindowW' : cannot convert parameter 2 from 'const char [18]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(54) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(55) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(80) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(81) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(129) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(130) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(137) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(138) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(145) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(146) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(154) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(155) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(168) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(169) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(173) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(174) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(299) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(300) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(304) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(305) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(319) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(320) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>inputEmulation.cpp 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.h(32) : error C2664: 'FindWindowW' : cannot convert parameter 2 from 'const char [18]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 1>Generating Code... 1>Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\av_bot\av_bot\Debug\BuildLog.htm" 1>av_bot - 2 error(s), 22 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
looks like you are compiling your program for UNICODE. Turn it off. Prject --> Properties (last menu item in the list), then expand the Configuration Properties and select General. Then on the right side of the screen change Character Set to Not Set
Some of those other warnings say that your program is downgrading a double to a long. You will have to decide which data type you want and either change or typecast it. In some cases typecasging will be ok, but in other cases it isn't. So you will have to make a decision on a case-for-case bases.
Some of those other warnings say that your program is downgrading a double to a long. You will have to decide which data type you want and either change or typecast it. In some cases typecasging will be ok, but in other cases it isn't. So you will have to make a decision on a case-for-case bases.
Last edited by Ancient Dragon; Nov 12th, 2007 at 12:15 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Oct 2005
Posts: 62
Reputation:
Solved Threads: 0
this is my new error build log
the warnings im not worrying about for now, just the linking part.
the warnings im not worrying about for now, just the linking part.
C++ Syntax (Toggle Plain Text)
1>------ Build started: Project: av_bot, Configuration: Debug Win32 ------ 1>Compiling... 1>stdafx.cpp 1>Compiling... 1>bot.cpp 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(54) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(55) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(80) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(81) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(125) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(126) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(133) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(134) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(141) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(142) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(150) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(151) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(164) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(165) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(169) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(170) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(295) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(296) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(300) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(301) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(315) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>c:\documents and settings\owner\my documents\av_bot (from josh)\bot.cpp(316) : warning C4244: '=' : conversion from 'double' to 'LONG', possible loss of data 1>inputEmulation.cpp 1>Generating Code... 1>Compiling manifest to resources... 1>Linking... 1>bot.obj : error LNK2019: unresolved external symbol __imp__SetForegroundWindow@4 referenced in function _main 1>bot.obj : error LNK2019: unresolved external symbol __imp__GetPixel@12 referenced in function "bool __cdecl compareColour(struct tagPOINT,struct myRGB)" (?compareColour@@YA_NUtagPOINT@@UmyRGB@@@Z) 1>bot.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "bool __cdecl compareColour(struct tagPOINT,struct myRGB)" (?compareColour@@YA_NUtagPOINT@@UmyRGB@@@Z) 1>bot.obj : error LNK2019: unresolved external symbol __imp__FindWindowA@8 referenced in function "void __cdecl `dynamic initializer for 'windowHandle''(void)" (??__EwindowHandle@@YAXXZ) 1>inputEmulation.obj : error LNK2001: unresolved external symbol __imp__FindWindowA@8 1>bot.obj : error LNK2019: unresolved external symbol __imp__GetSystemMetrics@4 referenced in function "void __cdecl `dynamic initializer for 'ScreenWidth''(void)" (??__EScreenWidth@@YAXXZ) 1>inputEmulation.obj : error LNK2001: unresolved external symbol __imp__GetSystemMetrics@4 1>inputEmulation.obj : error LNK2019: unresolved external symbol __imp__SendInput@12 referenced in function "void __cdecl pressKey(int * const,int,int)" (?pressKey@@YAXQAHHH@Z) 1>C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\av_bot\Debug\av_bot.exe : fatal error LNK1120: 6 unresolved externals 1>Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\av_bot\av_bot\Debug\BuildLog.htm" 1>av_bot - 9 error(s), 22 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Look up those functions in MSDN and it will tell you what libraries you have to link to. Then add them to the project link settings. Just enter the function name in the search box from here.
Last edited by Ancient Dragon; Nov 12th, 2007 at 8:52 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Linker Error (C++)
- Dev C++ linker errors, undefined reference (C++)
- DEV-C++ linker errors (C++)
- Why program works in Dev-C++ and not in VC++ 2005? (C++)
- Dev-C++, GLUI linker error, undefined reference (C++)
- Linking errors of socket functions (C)
Other Threads in the C++ Forum
- Previous Thread: Stack help: Run-Time Check Failure #2
- Next Thread: trying to display a join file
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph homeworkhelp iamthwee ifstream input int java lib library lines list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sorting spoonfeeding string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






