Solved

Linking warnings.

Posted on 2000-03-23
6
687 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 85
dog bark java program 15 119
Doc'in system (example?) BA 7 120
sumHeights  challenge 17 78
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‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 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