Advertisement

OT: error linking program...

Started by June 22, 2003 07:51 PM
3 comments, last by penetrator 21 years, 8 months ago
i get this error: MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBC.lib(malloc.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBC.lib(free.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBC.lib(crt0dat.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBC.lib(fflush.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in LIBC.lib(isctype.obj) LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library glhorizon.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. example.exe - 6 error(s), 1 warning(s) i tried to use the /NODEFAULTLIB switch first with MSVCRT.lib and then with LIBC.lib , but i get again other link errors. Any idea ?
Mind you that I know almost nothing about MSVC. However, msvcrt sure reminds me of msvc run-time, so perhaps libc.lib isn''t necessary at all...

Sometimes it only takes a mouse to draw someone''s attention - Me, Crispy

"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Advertisement
What exactly is the option you choose for the project when you''re creating a new one? Are you sure it is what you really want?
The project was working fine, than i added a fast fourier class which consists of two header files and two .lib files (which i added in the link options of my VC++ project ).
After this i get the above mentioned errors, seems that those definitions already exist in the libc library.

the thing i''d like to understand is: if for example _malloc is defined both in libc.lib and in mylib.lib, how can i decide which of the two to use ? If i use the /NODEFAULTLIB switch i disable a whole .lib file, so i also lose other important functions.

This topic is closed to new replies.

Advertisement