• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 378
  • Last Modified:

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???
0
racineconde
Asked:
racineconde
  • 3
1 Solution
 
racinecondeAuthor Commented:
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...
0
 
racinecondeAuthor Commented:
My mistake. The error remaining is:
//************
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

0
 
racinecondeAuthor Commented:
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
0
 
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now