I have been having some major issues with my Visual Studio 2008 Pro install. It will not compile any program, no matter how simple it is, without giving me at least 15 linker errors. I have tried a multitude of things including setting the dependency folders manually, reinstalling VS2008 and the Net Framework, installing the Windows SDK, made sure that the linker does not contain $noinherit, but none of it has worked.
Here are the error/output lists for a very simple program that refuses to compile: Error List Prog1:
Error 15 fatal error LNK1120: 13 unresolved externals F:\Users\GMan\Documents\Visual Studio 2008\Projects\TEst\Release\TEst.exe
Error 6 error LNK2001: unresolved external symbol __imp__UnhandledExceptionFilter@4 MSVCRT.lib
Error 4 error LNK2001: unresolved external symbol __imp__TerminateProcess@8 MSVCRT.lib
Error 2 error LNK2001: unresolved external symbol __imp__Sleep@4 MSVCRT.lib
Error 7 error LNK2001: unresolved external symbol __imp__SetUnhandledExceptionFilter@4 MSVCRT.lib
Error 8 error LNK2001: unresolved external symbol __imp__SetUnhandledExceptionFilter@4 MSVCRT.lib
Error 10 error LNK2001: unresolved external symbol __imp__QueryPerformanceCounter@4 MSVCRT.lib
Error 9 error LNK2001: unresolved external symbol __imp__IsDebuggerPresent@0 MSVCRT.lib
Error 1 error LNK2001: unresolved external symbol __imp__InterlockedExchange@8 MSVCRT.lib
Error 3 error LNK2001: unresolved external symbol __imp__InterlockedCompareExchange@12 MSVCRT.lib
Error 11 error LNK2001: unresolved external symbol __imp__GetTickCount@0 MSVCRT.lib
Error 14 error LNK2001: unresolved external symbol __imp__GetSystemTimeAsFileTime@4 MSVCRT.lib
Error 12 error LNK2001: unresolved external symbol __imp__GetCurrentThreadId@0 MSVCRT.lib
Error 13 error LNK2001: unresolved external symbol __imp__GetCurrentProcessId@0 MSVCRT.lib
Error 5 error LNK2001: unresolved external symbol __imp__GetCurrentProcess@0 MSVCRT.lib
Output for Prog1:
1>------ Build started: Project: TEst, Configuration: Release Win32 ------ 1>Linking... 1>Starting pass 1 1>Processed /DEFAULTLIB:msvcprt 1>Processed /DEFAULTLIB:MSVCRT 1>Processed /DEFAULTLIB:OLDNAMES 1>Searching libraries 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\kernel32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\user32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\gdi32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\winspool.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\comdlg32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\advapi32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\shell32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\ole32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\oleaut32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\uuid.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\odbc32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\odbccp32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\msvcprt.lib: 1> Found "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > std::cout" (__imp_?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) bool
__cdecl std::uncaught_exception(void)" (__imp_?uncaught_exception@std@@YA_NXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: char __thiscall std::basic_ios<char,struct std::char_traits<char>
>::fill(void)const " (__imp_?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (__imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (__imp_?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char>
>::tie(void)const " (__imp_?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char>
>::_Unlock(void)" (__imp_?_Unlock@?$basic_streambuf@DU?$开发者_如何学编程char_traits@D@std@@@std@@QAEXXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (__imp_?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (__imp_?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char>
>::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char>
>::rdbuf(void)const " (__imp_?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: void __thiscall std::basic_ios<char,struct std::char_traits<char>
>::setstate(int,bool)" (__imp_?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (__imp_?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: int __thiscall std::ios_base::width(int)" (__imp_?width@ios_base@std@@QAEHH@Z) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: int __thiscall std::ios_base::width(void)const " (__imp_?width@ios_base@std@@QBEHXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: int __thiscall std::ios_base::flags(void)const " (__imp_?flags@ios_base@std@@QBEHXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: bool __thiscall std::ios_base::good(void)const " (__imp_?good@ios_base@std@@QBE_NXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: int __thiscall std::ios_base::rdstate(void)const " (__imp_?rdstate@ios_base@std@@QBEHXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: static int __cdecl std::char_traits<char>::eof(void)" (__imp_?eof@?$char_traits@D@std@@SAHXZ) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" (__imp_?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found "__declspec(dllimport) public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (__imp_?length@?$char_traits@D@std@@SAIPBD@Z) 1> Referenced in main.obj 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found __IMPORT_DESCRIPTOR_MSVCP90 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found __NULL_IMPORT_DESCRIPTOR 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Found MSVCP90_NULL_THUNK_DATA 1> Referenced in msvcprt.lib(MSVCP90.dll) 1> Loaded msvcprt.lib(MSVCP90.dll) 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\MSVCRT.lib: 1> Found @__security_check_cookie@4 1> Referenced in main.obj 1> Loaded MSVCRT.lib(secchk.obj) 1> Found _mainCRTStartup 1> Loaded MSVCRT.lib(crtexe.obj) 1> Found
___report_gsfailure 1> Referenced in MSVCRT.lib(secchk.obj) 1> Loaded MSVCRT.lib(gs_report.obj) 1> Found ___security_cookie 1> Referenced in MSVCRT.lib(secchk.obj) 1> Referenced in MSVCRT.lib(gs_report.obj) 1> Loaded MSVCRT.lib(gs_cookie.obj) 1> Found
___CxxSetUnhandledExceptionFilter 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(unhandld.obj) 1> Found
__amsg_exit 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __imp____getmainargs 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__dowildcard 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(wildcard.obj) 1> Found __newmode 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(_newmode.obj) 1> Found _atexit 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(atonexit.obj) 1> Found __RTC_Terminate 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(_initsect_.obj) 1> Found __imp___cexit 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__imp___exit 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __XcptFilter 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__imp__exit 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __imp____initenv 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__IsNonwritableInCurrentImage 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(pesect.obj) 1> Found
__initterm 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found ___xc_a 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(cinitexe.obj) 1>Processed /DEFAULTLIB:kernel32.lib 1> Processed /DISALLOWLIB:libc.lib 1> Processed /DISALLOWLIB:libcd.lib 1> Processed /DISALLOWLIB:libcmt.lib 1> Processed /DISALLOWLIB:libcmtd.lib 1> Processed /DISALLOWLIB:msvcrtd.lib 1> Found __initterm_e 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
___native_startup_state 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(natstart.obj) 1> Found
__SEH_epilog4 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Referenced in MSVCRT.lib(atonexit.obj) 1> Loaded MSVCRT.lib(sehprolg4.obj) 1> Found __except_handler4 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Referenced in MSVCRT.lib(atonexit.obj) 1> Referenced in MSVCRT.lib(pesect.obj) 1> Referenced in MSVCRT.lib(sehprolg4.obj) 1> Loaded MSVCRT.lib(chandler4gs.obj) 1> Found __imp___configthreadlocale 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
___globallocalestatus 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(xthdloc.obj) 1> Found
__setdefaultprecision 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(fp8.obj) 1> Found __imp____setusermatherr 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __matherr 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(merr.obj) 1> Found __setargv 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(dllargv.obj) 1> Found __adjust_fdiv 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(adjustfd.obj) 1> Found
__imp___adjust_fdiv 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__commode 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(xncommod.obj) 1> Found __imp____p__commode 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__fmode 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(xtxtmode.obj) 1> Found __imp____p__fmode 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__imp___encode_pointer 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Referenced in MSVCRT.lib(atonexit.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __imp____set_app_type 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
___security_init_cookie 1> Referenced in MSVCRT.lib(crtexe.obj) 1> Loaded MSVCRT.lib(gs_support.obj) 1> Found __crt_debugger_hook 1> Referenced in MSVCRT.lib(gs_report.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found "void __cdecl terminate(void)" (?terminate@@YAXXZ) 1> Referenced in MSVCRT.lib(unhandld.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__IMPORT_DESCRIPTOR_MSVCR90 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __unlock 1> Referenced in MSVCRT.lib(atonexit.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found ___dllonexit 1> Referenced in MSVCRT.lib(atonexit.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__lock 1> Referenced in MSVCRT.lib(atonexit.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __imp___onexit 1> Referenced in MSVCRT.lib(atonexit.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__imp___decode_pointer 1> Referenced in MSVCRT.lib(atonexit.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found
__except_handler4_common 1> Referenced in MSVCRT.lib(chandler4gs.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __invoke_watson 1> Referenced in MSVCRT.lib(fp8.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found __controlfp_s 1> Referenced in MSVCRT.lib(fp8.obj) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Found MSVCR90_NULL_THUNK_DATA 1> Referenced in MSVCRT.lib(MSVCR90.dll) 1> Loaded MSVCRT.lib(MSVCR90.dll) 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\kernel32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\user32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\gdi32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\winspool.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\comdlg32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\advapi32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\shell32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\ole32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\oleaut32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\uuid.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\odbc32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio
9.0\VC\lib\odbccp32.lib: 1> Searching F:\Program Files\Microsoft Visual Studio 9.0\VC\lib\msvcprt.lib: 1>Finished searching libraries 1>Finished pass 1 1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol
__imp__InterlockedExchange@8 1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol
__imp__Sleep@4 1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol
__imp__InterlockedCompareExchange@12 1>MSVCRT.lib(gs_report.obj) : error LNK2001: unresolved external symbol
__imp__TerminateProcess@8 1>MSVCRT.lib(gs_report.obj) : error LNK2001: unresolved external symbol
__imp__GetCurrentProcess@0 1>MSVCRT.lib(gs_report.obj) : error LNK2001: unresolved external symbol
__imp__UnhandledExceptionFilter@4 1>MSVCRT.lib(gs_report.obj) : error LNK2001: unresolved external symbol
__imp__SetUnhandledExceptionFilter@4 1>MSVCRT.lib(unhandld.obj) : error LNK2001: unresolved external symbol
__imp__SetUnhandledExceptionFilter@4 1>MSVCRT.lib(gs_report.obj) : error LNK2001: unresolved external symbol
__imp__IsDebuggerPresent@0 1>MSVCRT.lib(gs_support.obj) : error LNK2001: unresolved external symbol
__imp__QueryPerformanceCounter@4 1>MSVCRT.lib(gs_support.obj) : error LNK2001: unresolved external symbol
__imp__GetTickCount@0 1>MSVCRT.lib(gs_support.obj) : error LNK2001: unresolved external symbol
__imp__GetCurrentThreadId@0 1>MSVCRT.lib(gs_support.obj) : error LNK2001: unresolved external symbol
__imp__GetCurrentProcessId@0 1>MSVCRT.lib(gs_support.obj) : error LNK2001: unresolved external symbol
__imp__GetSystemTimeAsFileTime@4 1>F:\Users\GMan\Documents\Visual Studio 2008\Projects\TEst\Release\TEst.exe : fatal error LNK1120: 13 unresolved externals 1>Build Time 0:00 1>Build log was saved at "file://f:\Users\GMan\Documents\Visual Studio 2008\Projects\TEst\TEst\Release\BuildLog.htm" 1>TEst - 15 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========
Code for Prog1:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
}
I was able to finally fix this. This happened because I had VS2008 installed across multiple hard drives, I had some files that were required to be installed on C:\ and then I installed the main program files onto F:\ and for some reason this caused the linker to crap out.
Reinstalled VS2008 entirely to my C partition and was able to compile a program without having to change anything. Not sure why this was happening. The links to the dependencies were all correct, but the linker refused to work for what ever reason.
精彩评论