Solved

Linking warnings.

Posted on 2000-03-23
6
685 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 135
java ^ examples 8 65
Use of condition with 'serial' in ansible 2 58
Problem to event 3 92
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 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

11 Experts available now in Live!

Get 1:1 Help Now