marksarnold
Programmer
I have a problem with VC++ 6:
I have a static library project and an application project that I want to use the library in.
The library is called loglib, the application logtest.
Compiling the library in its own workspace works fine.
Compiling the app in the app-workspace made problems because it didnt find the library's lib file. So I did "Insert Project into Workspace..." and added the lib project. Then I added the lib src path into the include path and added the dependency in "Project"->Dependencies".
This worked for a while, until I tried using printf in the library's code. This gives me:
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcd.lib(sprintf.obj)
I have no clue how to fix this...
The app has been already using printf, so that might be the problem, but I dont know how to get this to work...
Just in case this has anything to do withit, I also get 3 warnings form the linker... Here is the entire output:
Linking...
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcd.lib(sprintf.obj)
LINK : warning LNK4098: defaultlib "mfc42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcs42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/LibTestStatic.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Any ideas?
Thanks a lot,
MARK
I have a static library project and an application project that I want to use the library in.
The library is called loglib, the application logtest.
Compiling the library in its own workspace works fine.
Compiling the app in the app-workspace made problems because it didnt find the library's lib file. So I did "Insert Project into Workspace..." and added the lib project. Then I added the lib src path into the include path and added the dependency in "Project"->Dependencies".
This worked for a while, until I tried using printf in the library's code. This gives me:
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcd.lib(sprintf.obj)
I have no clue how to fix this...
The app has been already using printf, so that might be the problem, but I dont know how to get this to work...
Just in case this has anything to do withit, I also get 3 warnings form the linker... Here is the entire output:
Linking...
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcd.lib(sprintf.obj)
LINK : warning LNK4098: defaultlib "mfc42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcs42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/LibTestStatic.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Any ideas?
Thanks a lot,
MARK