1

I'm using visual studio 2003 and I'm getting the following linking error in my project:

Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: _fprintf already defined in LIBCMTD.lib(fprintf.obj)
C:\Documents and Settings\mz07\Desktop\project\HLconsoleExample\Debug\HLconsoleExample.exe : fatal error LNK1169: one or more multiply defined symbols found

I then included libcmtd.lib into "ignore specific library" line and got another error:

Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
LINK : error LNK2020: unresolved token (0A000037) _CxxThrowException
LINK : error LNK2020: unresolved token (0A000039) delete
LINK : fatal error LNK1120: 2 unresolved externals

This is the beginning of my main class:

#include <cstdio>
#include <iostream>
#if defined(WIN32)
# include <conio.h>
#else
# include "conio.h"
#endif
#include <HL/hl.h>
#include <HD/hd.h>
#include <HDU/hduVector.h>
#include <HDU/hduError.h>
...
int main(int argc, char *argv[])
{
 HHD hHD;
 HHLRC hHLRC;
 HDErrorInfo error;
...
}

I included all the libraries I'm using into the Linker properties. Here is the Command Line output of it:

/OUT:"C:\Documents and Settings\mz07\Desktop\project\HLconsoleExample\Debug\HLconsoleExample.exe" /INCREMENTAL /NOLOGO /NODEFAULTLIB:"libcmtd.lib" /DEBUG /ASSEMBLYDEBUG /PDB:"C:\Documents and Settings\mz07\Desktop\project\HLconsoleExample\Debug/HLconsoleExample.pdb" /FIXED:No hl.lib hd.lib HDUD.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 "\Program Files\SensAble3円DTouch\lib\hl.lib" "\Program Files\SensAble3円DTouch\lib\hd.lib" "\Program Files\SensAble3円DTouch\utilities\src\Hdu\Debug\HDUD.lib"

I am new to c++ and I don't really understand how linking works :) so any help is appreciated.

asked Jan 22, 2010 at 13:30

1 Answer 1

3

You are linking a .lib whose code was compiled with an incompatible compiler setting. The problem one is Project + Properties, C/C++, Code Generation, Runtime library. /MD is not compatible with /MT. You'll either have to rebuild the .libs to match your .exe project setting or the other way around.

answered Jan 22, 2010 at 13:35
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.