Ethereal-dev: Re: [Ethereal-dev] errors linking ethereal CVS - Visual Studio .NET Professional

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Mon, 05 Jan 2004 09:53:15 +0100
Andrew Hood wrote:

I'm new to Visual Studio .NET Professional and I've got the build to get as far as linking. What do I need to do to fix this:

Linking ethereal.exe
        link @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nm1FE.tmp
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _atoi already defined in LIBC.lib(atox.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _strncmp already defined in LIBC.lib(strncmp.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _strchr already defined in LIBC.lib(strchr.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _atol already defined in LIBC.lib(atox.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _strncpy already defined in LIBC.lib(strncpy.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _tolower already defined in LIBC.lib(tolower.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _memmove already defined in LIBC.lib(memmove.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _exit already defined in LIBC.lib(crt0dat.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _getenv already defined in LIBC.lib(getenv.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _malloc already defined in LIBC.lib(malloc.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _free already defined in LIBC.lib(free.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: __open already defined in LIBC.lib(open.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: __close already defined in LIBC.lib(close.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: __get_osfhandle already defined in LIBC.lib(osfinfo.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _calloc already defined in LIBC.lib(calloc.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: _realloc already defined in LIBC.lib(realloc.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: __isctype already defined in LIBC.lib(isctype.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: __strdup already defined in LIBC.lib(strdup.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: __read already defined in LIBC.lib(read.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: __write already defined in LIBC.lib(write.obj) MSVCRT.lib(MSVCR70.dll) : error LNK2005: __lseek already defined in LIBC.lib(lseek.obj) LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library ethereal.exe : fatal error LNK1169: one or more multiply defined symbols found
NMAKE : fatal error U1077: 'link' : return code '0x491'

This problem doesn't appear with MSVC6, and I'm working with MSVC 6 only, so I can give you only general information.

Well, it seems, that you are linking with two standard libs (MSVCRT.lib and LIBC.lib), both containing some standard symbols (like _atoi).

The important line is:
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

Try to add /NODEFAULTLIB:LIBC (or LIBC.lib?) to your linker settings (LOCAL_LDFLAGS in config.nmake), or do you use the IDE?

Regards, ULFL