473,327 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

linking errors

Hi there,

I've been working with dynamic libraries for a quite big software and now
and then I may get some weird linking errors, like following

MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _fprintf already defined in
libcmtd.lib(fprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _swprintf already defined in
libcmtd.lib(swprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _free already defined in
libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _malloc already defined in
libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _printf already defined in
libcmtd.lib(printf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _strchr already defined in
libcmtd.lib(strchr.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _sprintf already defined in
libcmtd.lib(sprintf.obj)

The symbols invovled in the linking errors are actually some basic c++
library functions and I used them in many other places. The problem
disappeared for some unknown reason before, but this time they just refuse to
go. Any idea what's causing the problem and what I should do to get rid of
this kind of problem. Suggestions are really appreciated. Thanks.

rich

Nov 17 '05 #1
3 4595
Are all your cpp files compiled with the same CRT library setting (e. g.
/MD)?
"rich" <ri**@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
Hi there,

I've been working with dynamic libraries for a quite big software and now
and then I may get some weird linking errors, like following

MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _fprintf already defined in
libcmtd.lib(fprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _swprintf already defined in
libcmtd.lib(swprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _free already defined in
libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _malloc already defined in
libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _printf already defined in
libcmtd.lib(printf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _strchr already defined in
libcmtd.lib(strchr.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _sprintf already defined in
libcmtd.lib(sprintf.obj)

The symbols invovled in the linking errors are actually some basic c++
library functions and I used them in many other places. The problem
disappeared for some unknown reason before, but this time they just refuse
to
go. Any idea what's causing the problem and what I should do to get rid of
this kind of problem. Suggestions are really appreciated. Thanks.

rich

Nov 17 '05 #2
I guess so. In this specific solution, I have two projects and I set both of
them as /MTd (this is the required setting). But I am not sure if one/some of
the cpp files are using other CRT library setting, while I didn't realize it?
Is there any way I can check? By the way, last time I had a similar problelm
and the way I found to handle it was remove specific files from a project and
then add them back. I know it doesn't make much sense, but the error doesn't
make sense either to me.

Regards, rich

"Marcus Heege" wrote:
Are all your cpp files compiled with the same CRT library setting (e. g.
/MD)?
"rich" <ri**@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
Hi there,

I've been working with dynamic libraries for a quite big software and now
and then I may get some weird linking errors, like following

MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _fprintf already defined in
libcmtd.lib(fprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _swprintf already defined in
libcmtd.lib(swprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _free already defined in
libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _malloc already defined in
libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _printf already defined in
libcmtd.lib(printf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _strchr already defined in
libcmtd.lib(strchr.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _sprintf already defined in
libcmtd.lib(sprintf.obj)

The symbols invovled in the linking errors are actually some basic c++
library functions and I used them in many other places. The problem
disappeared for some unknown reason before, but this time they just refuse
to
go. Any idea what's causing the problem and what I should do to get rid of
this kind of problem. Suggestions are really appreciated. Thanks.

rich


Nov 17 '05 #3
Hi Marcus, Thanks a lot for your advice. I just checked and found one of my
cpp files are using a different CRT library. Thanks again.

rich

"Marcus Heege" wrote:
Are all your cpp files compiled with the same CRT library setting (e. g.
/MD)?
"rich" <ri**@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
Hi there,

I've been working with dynamic libraries for a quite big software and now
and then I may get some weird linking errors, like following

MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _fprintf already defined in
libcmtd.lib(fprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _swprintf already defined in
libcmtd.lib(swprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _free already defined in
libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _malloc already defined in
libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _printf already defined in
libcmtd.lib(printf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _strchr already defined in
libcmtd.lib(strchr.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _sprintf already defined in
libcmtd.lib(sprintf.obj)

The symbols invovled in the linking errors are actually some basic c++
library functions and I used them in many other places. The problem
disappeared for some unknown reason before, but this time they just refuse
to
go. Any idea what's causing the problem and what I should do to get rid of
this kind of problem. Suggestions are really appreciated. Thanks.

rich


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joonas Paalasmaa | last post by:
Hi, When compiling Sketch's streamfilter C extension the errors below are raised during linking. What could cause the errors? (Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98) Here are...
0
by: SM | last post by:
Hi, While linking orbix C++ application, we get a lot of linking errors. Few errors are pasted below. If someone could tell us which are the libraries that need to be added, it would be of help....
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
3
by: Saurabh Aggrawal | last post by:
Hi, I am porting an application for 64-bit AMD processor and while linking the application i am getting the following errors: Processing directory uidll... Linking DLL...
0
by: Chris | last post by:
Hi I have a project that was written in V6.0 (c/c++) and it works just fine, but when I run it in .NET 2003 (V7.0), I get a whole lot of linking errors. I have spent alot of time trying to...
1
by: Venky | last post by:
I'm compiling a C program that is using Interbase 6.0 APIS. Getting the following errors at the time of linking. Linking test.exe: Linker Warning: No module definition file specified: using...
0
by: Adam Clauss | last post by:
I have managed C++ library (is bridging between a Win32 .dll and a C# application). All was well when compiled under VS2003, but I am running into a series of linking errors when compiling...
3
by: walkeraj | last post by:
I'm trying to compile an open source game called IVAN , and I'm able to compile it from a makefile, but not from an IDE. I have attempted to recreate the way the makefile compiles the project as...
2
by: pssraju | last post by:
Hi, At present application was built on solaris 9 using sun studio 9 (Sun C++ 5.6) & rouguewave sorce pro 5. We are planning to port the same application onto SuSE Linux 9.5.0 using GCC 3.3.3 & RW...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.