simple lib and simple dll 
Author Message
 simple lib and simple dll

hi folks,

i have built a c++ library (not using mfc) with a few utility classes in it.
The library uses the wsock32.lib provided with the compiler.  i am able to
build the library just fine.

after this, i have built a dll (again, not using mfc) that invokes classes
from the first library.  this dll builds, but does not link- i get 23
errors, all equivelant to the following:

LIBCD.lib(crt0dat.obj) : error LNK2005: __cinit already defined in
LIBCMTD.lib(crt0dat.obj)

i think i understand what's going on but i have no idea how to get around
it.

any clues ?

thanks,

dylan



Fri, 12 Jul 2002 03:00:00 GMT  
 simple lib and simple dll
Roughly speaking the problem is that the library (which gets linked into
the DLL) is using a different C run time library. One solution is to
'standardize' and always use the same C run time library. Failing that,
create a different project or configuration for the library and make the
DLL use it.

It is a pain, I don't know of a good way of dealing with it, rant, rant,
rant.

You can also use nodefaultlib to fix some of these problems, but that
can be dangerous.

Quote:

> hi folks,

> i have built a c++ library (not using mfc) with a few utility classes in it.
> The library uses the wsock32.lib provided with the compiler.  i am able to
> build the library just fine.

> after this, i have built a dll (again, not using mfc) that invokes classes
> from the first library.  this dll builds, but does not link- i get 23
> errors, all equivelant to the following:

> LIBCD.lib(crt0dat.obj) : error LNK2005: __cinit already defined in
> LIBCMTD.lib(crt0dat.obj)

> i think i understand what's going on but i have no idea how to get around
> it.

> any clues ?

> thanks,

> dylan

--
.Bruce Dawson, Cavedog Entertainment.
Makers of Total Annihilation - http://www.cavedog.com


Fri, 12 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Simple .lib question

2. Seeking simple PC sound lib in C

3. Calling a simple FORTRAN subroutine from my simple C program

4. Simple problem across processes - need simplest answer

5. Simple ATL Com object problem on simplest examples

6. Simple But Not Too Simple

7. Simple MAPI: Not so simple:(

8. a simple simple question...

9. simple simple print question

10. a simple compiler in dll form

11. Simple dll example

12. simple DLL example (Serv-u)

 

 
Powered by phpBB® Forum Software