Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linking warnings.

Posted on 2000-03-23
6
Medium Priority
?
691 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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 105 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

670 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