I'm getting a whole bunch of linker errors in Visual studios for methods I'm not even calling directly. I'm a java developer by day, but I have a project I need to do in C++, intended to run on windows machines. Hence, I'm stuck messing about with Visual Studio.
Bascally, I have an os project that I added an accessor method to. I compiled that project as a .lib file (compiles and links fine).
I then have my own project that uses that lib. I've included the library under Project->Properties -> Linker -> Input, and set the appropriate directory in the General -> Additional Lib Directories. I've included the header in the appropriate file, and I'm simply calling the constructor of one of the classes...not even calling the method that I created yet.
The code compiles, but I get the following mountain of linker errors -- mostly LNK2019 and LNK2001 errors. I've tried recompiling under different settings (lib, exe, etc.), and the linker errors only seem to multiply. When I switch back to the previous settings, the number of errors remain at their peak. Any ideas how to fix this?
Build Log
Build started: Project: SpamCapture, Configuration: Debug|Win32
Command Lines
Creating temporary file "c:\SpamCapture\SpamCapture\SpamCapture\Debug\RSP0000103081740.rsp" with contents [ /VERBOSE:LIB /OUT:"C:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.exe" /INCREMENTAL /LIBPATH:"C:\SpamCapture\Config\Debug\" /MANIFEST /MANIFESTFILE:"Debug\SpamCapture.exe.intermediate.manifest" /NODEFAULTLIB:"libcmtd.lib" /NODEFAULTLIB:"nafxcwd.lib" /DEBUG /PDB:"c:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 KeyCapture_Config.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\Interaction.obj"
".\Debug\InteractionSet.obj"
".\Debug\LogReader.obj"
".\Debug\SpamCapture.obj"
".\Debug\stdafx.obj"
".\Debug\SpamCapture.res"
".\Debug\SpamCapture.exe.embed.manifest.res" ] Creating command line "link.exe @c:\SpamCapture\SpamCapture\SpamCapture\Debug\RSP0000103081740.rsp /NOLOGO /ERRORREPORT:PROMPT"
Output Window
Linking... LINK : warning LNK4067: ambiguous entry point; selected 'mainCRTStartup' Searching libraries Searching C:\SpamCapture\Config\Debug\KeyCapture_Config.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\MSVCRTD.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfcs80ud.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atlsd.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\wininet.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib: Searching C:\SpamCapture\Config\Debug\KeyCapture_Config.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\MSVCRTD.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfcs80ud.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atlsd.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\wininet.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib: Searching C:\SpamCapture\Config\Debug\KeyCapture_Config.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib: Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib: Finished searching libraries
Linker Errors start here:
KeyCapture_Config.lib(KeyCapture_ConfigDlg.obj) : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWnd::Create(char const *,char const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,struct CCreateContext *)" (?Create@CWnd@@UAEHPBD0KABUtagRECT@@PAV1@IPAUCCreateContext@@@Z)
... a bunch more like this
KeyCapture_Config.lib(KeyCapture_ConfigDlg.obj) : error LNK2019: unresolved external symbol "public: struct HICON__ * thiscall CWinApp::LoadIconA(unsigned int)const " (?LoadIconA@CWinApp@@QBEPAUHICON@@I@Z) referenced in function "public: __thiscall CKeyCapture_ConfigDlg::CKeyCapture_ConfigDlg(class CWnd *)" (??0CKeyCapture_ConfigDlg@@QAE@PAVCWnd@@@Z)
...a bunch more like this
(?DoDataExchange@SetupDialog@@MAEXPAVCDataExchange@@@Z) C:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.exe : fatal error LNK1120: 34 unresolved externals
Results
Build log was saved at "file://c:\SpamCapture\SpamCapture\SpamCapture\Debug\BuildLog.htm" SpamCapture - 44 error(s), 1 warning(s)