Reputation:
I am trying to compile existing project created using wxWidgets library. I successfully compiled wxWidgets 2.8.12 library. Now, I am trying to compile my project. But I get error:
fatal error LNK1104: cannot open file 'wxbase28d.lib'
Afterwards I added some variables in settings like:
C/C++->Preprocessor Definitions:
WIN32;__WXMSW__;_WINDOWS;_DEBUG;__WXDEBUG__;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
VC++ Directories->Include Directories:
D:\instantclient_12_1\sdk\include;$(WXWIN)\lib\vc_lib\mswd;$(WXWIN)\include;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;
Linker->General->Additional Library Directories:
$(WXWIN)\lib\vc_lib;E:\app\vasyl\product\11.1.0\db_1\OCI\lib\MSVC\vc71;$(WXDIR284)\lib\vc_lib;%(AdditionalLibraryDirectories)
Resources->General->Additional Include directories:
$(WXWIN)\include;c:\wxMSW284\include;$(WXDIR284)\include;%(AdditionalIncludeDirectories)
Now, the situation is like this:
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgrealloc.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _tolower already defined in LIBCMTD.lib(tolower.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _isalpha already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _isdigit already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _isspace already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _strtol already defined in LIBCMTD.lib(strtol.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _strtoul already defined in LIBCMTD.lib(strtol.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __strtoi64 already defined in LIBCMTD.lib(strtoq.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __strtoui64 already defined in LIBCMTD.lib(strtoq.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __errno already defined in LIBCMTD.lib(dosmap.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __vsprintf_p already defined in LIBCMTD.lib(vsnprnc.obj)
...
...
etc.
Can someone help me spot what am I doing wrong?
Upvotes: 5
Views: 2082
Reputation: 22688
You're using different CRT settings (static vs DLL) for your project and the library. Make sure to (re)build both of them using the same option, either /MD[d]
or /MT[d]
.
Upvotes: 1
Reputation: 111
There are many possible causes for this linker error. First adress to check is MSDN: https://msdn.microsoft.com/en-us/library/ts7eyw4s.aspx
What is $(WXWIN)
and how does it differ from $(WXDIR284)
? It seems, you include wxWidgets path twice...
Upvotes: 0