Search code examples
c++visual-studio-2010wxwidgets

LNK1104: cannot open file 'wxbase28d.lib'


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?


Solution

  • 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].