Link Errors : error LNK2005 and LNK2004 
Author Message
 Link Errors : error LNK2005 and LNK2004

Hi all,

I'm trying to port a dll that was orignally written and build in Watcom
to MF VC++ 5.0.  I can get all the code to compile but when I attemp to
link it, I get the following messages:

Linking...
Microsoft (R) 32-Bit Incremental Linker Version 5.10.7303
Copyright (C) Microsoft Corp 1992-1997. All rights reserved.
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
e:\apis\kcicalc.dll\strx\strx\release\strx.lib /subsystem:windows /dll
/incremental:no "/pdb:Release/kcicalc
3.pdb" /machine:I386 "/out:Release/kcicalc3.dll"
"/implib:Release/kcicalc3.lib"
.\Release\alloca.obj
.\Release\allocate.obj
.\Release\ANGLO.OBJ
.\Release\CALC.OBJ
.\Release\DLL.OBJ
.\Release\ENGINE.OBJ
.\Release\eqncvt.obj
.\Release\mcookie.obj
.\Release\pargram.obj
.\Release\parlex.obj
.\Release\stack.obj
.\Release\utils.obj
DLL.OBJ : error LNK2005: _convfns already defined in CALC.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ

ANGLO.OBJ
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other
libs; use /NODEFAULTLIB:library
eqncvt.obj : error LNK2001: unresolved external symbol "public: int
__thiscall str::replace(class regX const &,char const *,int *,int)"

eqncvt.obj : error LNK2001: unresolved external symbol "public: int
__thiscall str::search(class regX const &,class str *,int)const "

eqncvt.obj : error LNK2001: unresolved external symbol "public: int
__thiscall str::replaceAll(class regX const &,char const *,int)"

Release/kcicalc3.dll : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

kcicalc3.dll - 20 error(s), 77 warning(s)

Does anybody have any clue what these errors mean.  The _convfns,
str::replace, str::search, and str::replaceALL functions are ones that I
can find at least the name and functions in my code, but the

using the built in help but thats coming slowly so I thought I would try
here at the same time.  Any help would be greatly appreciated.

Thanks in advance.

Nick

--------------------------------------------
Take off Late, Get Deep, Go Down Hard...




Tue, 08 Oct 2002 03:00:00 GMT  
 Link Errors : error LNK2005 and LNK2004


Quote:
> Hi all,

> I'm trying to port a dll that was orignally written and build in Watcom
> to MF VC++ 5.0.  I can get all the code to compile but when I attemp to
> link it, I get the following messages:

> Linking...
> Microsoft (R) 32-Bit Incremental Linker Version 5.10.7303
> Copyright (C) Microsoft Corp 1992-1997. All rights reserved.
> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
> shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
> e:\apis\kcicalc.dll\strx\strx\release\strx.lib /subsystem:windows /dll
> /incremental:no "/pdb:Release/kcicalc
> 3.pdb" /machine:I386 "/out:Release/kcicalc3.dll"
> "/implib:Release/kcicalc3.lib"
> .\Release\alloca.obj
> .\Release\allocate.obj
> .\Release\ANGLO.OBJ
> .\Release\CALC.OBJ
> .\Release\DLL.OBJ
> .\Release\ENGINE.OBJ
> .\Release\eqncvt.obj
> .\Release\mcookie.obj
> .\Release\pargram.obj
> .\Release\parlex.obj
> .\Release\stack.obj
> .\Release\utils.obj
> DLL.OBJ : error LNK2005: _convfns already defined in CALC.OBJ

> ANGLO.OBJ

<repeated errors snipped>

Quote:
> LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other
> libs; use /NODEFAULTLIB:library

<others errors snipped>

Taken directly from MSDN -

<begin MSDN entry>
Linker Tools Error LNK2005
symbol already defined in object

The given symbol, displayed in its decorated form, was multiply defined.

Tips

One of the following may be a cause:

The most common cause of this error is accidentally linking with both the
single-threaded and multithreaded libraries. Ensure that the application
project file includes only the appropriate libraries and that any
third-party libraries have appropriately created single-threaded or
multithreaded versions.

The given symbol was a packaged function (created by compiling with /Gy) and
was included in more than one file but was changed between compilations.
Recompile all files that include the symbol.

The given symbol was defined differently in two member objects in different
libraries, and both member objects were used.

An absolute was defined twice, with a different value in each definition.
<end MSDN entry>

Now, considering you've also got the LNK 4098 warning, my suggestion would
be to check which libraries you are linking with.

MSDN is available on-line if you don't have a local copy at
http://msdn.miscrosoft.com/library/

That might give you a starting point.
Hope that helps.

--
Regards,
Steve Folly.
http://www.spfweb.co.uk/




Fri, 11 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. PRB: LNK2005 Errors When Link C Run-Time Libraries Are Linked Before MFC Libraries (Q148652)

2. Please Help! - Link Error LNK2005

3. help- Link error LNK2005

4. LNK2005 Link errors when doing Release Build??

5. link problem, error LNK2005 using CSocket

6. Please Help! - Link Error LNK2005

7. LNK2005 Link errors when doing Release Build??

8. Link error (LNK2005) - Any suggestions

9. LINK : fatal error LNK1000: unknown error

10. LINK : fatal error LNK1000: Internal error during BuildImage

11. LINK : error : Internal error during Pass1

12. LINK : error : Internal error during EmitMap

 

 
Powered by phpBB® Forum Software