Building modes : Release is working, Debug is not working

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
TigrouMeow
Knows some wx things
Knows some wx things
Posts: 34
Joined: Sat Feb 11, 2006 8:45 am

Building modes : Release is working, Debug is not working

Post by TigrouMeow » Sun Feb 12, 2006 5:38 am

Hello,

Now i have another problem :)
With the samples, release building is working... no problem. But Debug, not. I can get several errors :
Linking...
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strchr already defined in LIBCMTD.lib(strchr.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _isdigit already defined in LIBCMTD.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _tolower already defined in LIBCMTD.lib(tolower.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _isalnum already defined in LIBCMTD.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strftime already defined in LIBCMTD.lib(strftime.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __strnicmp already defined in LIBCMTD.lib(strnicmp.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _isspace already defined in LIBCMTD.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _isalpha already defined in LIBCMTD.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _wcslen already defined in LIBCMTD.lib(wcslen.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _exit already defined in LIBCMTD.lib(crt0dat.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strtol already defined in LIBCMTD.lib(strtol.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strtoul already defined in LIBCMTD.lib(strtol.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strpbrk already defined in LIBCMTD.lib(strpbrk.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _abort already defined in LIBCMTD.lib(abort.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _getenv already defined in LIBCMTD.lib(getenv.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _setlocale already defined in LIBCMTD.lib(setlocal.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __stricmp already defined in LIBCMTD.lib(stricmp.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __close already defined in LIBCMTD.lib(close.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __write already defined in LIBCMTD.lib(write.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __commit already defined in LIBCMTD.lib(commit.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __lseeki64 already defined in LIBCMTD.lib(lseeki64.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __get_osfhandle already defined in LIBCMTD.lib(osfinfo.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __CrtSetDbgFlag already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _mbstowcs already defined in LIBCMTD.lib(mbstowcs.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _wcstombs already defined in LIBCMTD.lib(wcstombs.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBCMTD.lib(typinfo.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBCMTD.lib(typinfo.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __fileno already defined in LIBCMTD.lib(fileno.obj)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

I'm using these librairies :
wxmsw26d_core.lib wxbase26d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib oleacc.lib odbc32.lib

I tried to "Ignore a specific library"... LIBCMTD.lib or MSVCRTD.lib, but i get even more errors...

There is another problem, but i can't understand it :
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall wxStringData::Free(void)" ([email protected]@@QAEXXZ) referenced in function "public: void __thiscall wxStringData::Unlock(void)" ([email protected]@@QAEXXZ)
myFrame.obj : error LNK2001: unresolved external symbol "public: void __thiscall wxStringData::Free(void)" ([email protected]@@QAEXXZ)
wxAsmBox.obj : error LNK2001: unresolved external symbol "public: void __thiscall wxStringData::Free(void)" ([email protected]@@QAEXXZ)
Debug/WxPID.exe : fatal error LNK1120: 1 unresolved externals
How to get rid of these problems ?

Thank you ! :'(

protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Post by protocol » Sun Feb 12, 2006 6:42 am

What compiler || IDE are you using? Because the fix actions I know are based on the development application.
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!

TigrouMeow
Knows some wx things
Knows some wx things
Posts: 34
Joined: Sat Feb 11, 2006 8:45 am

Post by TigrouMeow » Sun Feb 12, 2006 7:01 am

Visual Studio 2005...

User avatar
T-Rex
Moderator
Moderator
Posts: 1193
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Post by T-Rex » Sun Feb 12, 2006 12:49 pm

1. Check if Use Unicode Libraries flags are identical in your wxWidgets library project and in your app project.
2. Place all your string constants into _() or wxT() macro
3. Check if your Prohect -> Properties -> C/C++ -> Code Generation options are identical in your wxWidgets library project and in your app project (for Debug and Release separately).
4. Check if you are using Release versions of wx libraries for Release build of your app (wxbase26.lib wxmsw26_core.lib etc.)

protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Post by protocol » Sun Feb 12, 2006 11:03 pm

Ummm... install wxDevCpp. I have Visual C++ 2005, but I don't use it because there is no GUI support for VS 2005 yet and it uses/needs MFC8?.dll
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!

Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

Post by Vexator » Mon Feb 13, 2006 11:03 am

Code: Select all

LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
make sure you compile the samples with the same configuration as wx itself, i.e. if you compiled wx with "multi-threaded dll" or "multi-threaded", check that the samples have set the same.
Windows 7 Pro
Visual Studio 2010
wxWidgets 2.9.3

chenzhengxi
Earned a small fee
Earned a small fee
Posts: 22
Joined: Tue Jan 17, 2006 9:49 am

Post by chenzhengxi » Mon Feb 13, 2006 10:40 pm

:)
I have the same problem
ignore below,it will ok.I am using it :D
MSVCRTD.lib
LIBCMT.lib
LIBC.lib
LIBCMTD.lib
LIBCD.lib

TigrouMeow
Knows some wx things
Knows some wx things
Posts: 34
Joined: Sat Feb 11, 2006 8:45 am

Post by TigrouMeow » Thu Feb 16, 2006 6:47 am

I modified the compilation options of VS and now... it's working too.. very strange ;)

celstark
Knows some wx things
Knows some wx things
Posts: 43
Joined: Fri Aug 26, 2005 7:37 pm

Post by celstark » Thu Apr 20, 2006 9:03 pm

Vexator wrote:

Code: Select all

LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
make sure you compile the samples with the same configuration as wx itself, i.e. if you compiled wx with "multi-threaded dll" or "multi-threaded", check that the samples have set the same.
I'd had this same issue and this was the perfect fix -- the samples were setup with the DLL version and I'd compiled wxWidgets with the non-DLL (Express 2005 wxWidgets 2.6.3). Thanks!

Craig

Post Reply