Link to home
Start Free TrialLog in
Avatar of racineconde
racineconde

asked on

error LNK2005 and error LNK2019 and warning LNK4098

I enable the default library as adviced by David.
These are the error I got when  enable the default library:
To make things more clear, I will just add some blank lines between the different errors...
//****************************************************************************
error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)

error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)

warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
//**************************************************************************

ANY CLUES???
Avatar of racineconde
racineconde

ASKER

The following errors are solved it by putting 'LIBCMT.lib' in the option 'Ignore specific library' in the project properties dialox box.
//******* first error solved
error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
//******* 2nd error solved
error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)



Now the errors remaining are:
//************ error one
warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
//************ error two
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup


Thanks anyway for trying...
My mistake. The error remaining is:
//************
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

This question is now closed. I've fix the problems by adding the following lines in my stdafx.h file

//--------------------------
#define WIN32_LEAN_AND_MEAN            
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
//-----------------------------

Thank for trying

Racine
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial