Solved

Linking warnings.

Posted on 2000-03-23
6
683 Views
Last Modified: 2013-11-20
I've been getting some linking warnings that I don't know how to
get rid of.  The only way that I can get my program to compile
is to use \FORCE.  Has anyone else encountered the following
situation?

LINK : warning LNK4075: ignoring /INCREMENTAL due to /FORCE specification
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _malloc already defined in libcmtd.lib(dbgheap.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fprintf already defined in libcmtd.lib(fprintf.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _realloc already defined in libcmtd.lib(dbgheap.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _free already defined in libcmtd.lib(dbgheap.obj); second definition ignored
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library

I've tried various combinations of using /NODEFAULTLIB
(including msvcrt.lib but not libcmtd.lib, etc, etc. etc) but each
of these results in more linking errors.

My program does run fine when I use the /FORCE option but it
does bother me that I'm unable to get rid of these warnings
altogether.

Any suggestions?
0
Comment
Question by:mosaicer
6 Comments
 
LVL 5

Expert Comment

by:vachooho
ID: 2651412
menu Project->Settings
"Link" tab
category "Input"
Object/library modules: MSVCRT.lib libcmtd.lib
Ignore libraries: MSVCRT.lib libcmtd.lib

YOu tell DevStudio to ignore both libaraies and specify them in correct order - MSVCRT.lib first.

The error caused with the functions presented in both libraries.
0
 

Author Comment

by:mosaicer
ID: 2651677
Ok, tried that and I get:

LINK : warning LNK4075: ignoring /INCREMENTAL due to /FORCE specification
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(dbgheap.obj) : warning LNK4006: _malloc already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(dbgheap.obj) : warning LNK4006: _calloc already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(dbgheap.obj) : warning LNK4006: _realloc already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(dbgheap.obj) : warning LNK4006: __expand already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(dbgheap.obj) : warning LNK4006: _free already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(dbgheap.obj) : warning LNK4006: __msize already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(crt0dat.obj) : warning LNK4006: _exit already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(crt0dat.obj) : warning LNK4006: __exit already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(mbctype.obj) : warning LNK4006: __setmbcp already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(strcat.obj) : warning LNK4006: _strcpy already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrt.lib(cinitexe.obj); second definition ignored
libcmtd.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrt.lib(cinitexe.obj); second definition ignored
libcmtd.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrt.lib(cinitexe.obj); second definition ignored
libcmtd.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrt.lib(cinitexe.obj); second definition ignored
libcmtd.lib(dosmap.obj) : warning LNK4006: ___doserrno already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(winxfltr.obj) : warning LNK4006: __XcptFilter already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(strftime.obj) : warning LNK4006: _strftime already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/DibEditor.exe : warning LNK4088: image being generated due to /FORCE option; image may not run

DibEditor.exe - 1 error(s), 32 warning(s)
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2652638
See MSDN article Q148652...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:Mattorama
ID: 2653807
You are probably trying to link multiple modules that have been compiled using different threading models. In Project Settings, C/C++ tab, Code Generation, change to a multithreaded model.
0
 

Author Comment

by:mosaicer
ID: 2653959
Yes, I've already got it set to
Debug Multithreaded.

The ordering thing is weird also.
According to Q148652, I need
to have it link
MSVCRT before LIBCMTD but when I do
that, I get a load of errors as
noted above.  If I do it the
other way (LIBCMTD first), then
I only get a few errors (first message).

Although the program runs fine with
the /FORCE, it is still a little
unsettling that I have to use this
in the first place.  It makes
me nervous when I can't get rid
of all of the warnings.


0
 
LVL 1

Accepted Solution

by:
Dhrubajyoti earned 35 total points
ID: 2734586
i think u are using two header file
which have the same function defination
if u have includede malloc.h

just remove the include statement
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now