Re: #pragma lib buggers everything up
- From: "Bonj" <a@xxxxx>
- Date: Tue, 3 May 2005 18:12:13 +0100
> But of course. EXE and DLL are two separate modules, they cannot share
> code. If both link against a static library and use the same function or
> class from said library, both end up with a copy of the code. This has
> nothing to do with #pragma lib. If you want two modules to share code, you
> have to factor this common code into yet another DLL, and link both
> modules against it.
The issue with this was lots of linker errors citing 'function xxx is
already defined in module yyy.obj', however this was due to the fact that
the static library was being compiled with /MDd while the application was
being compiled as /MTd, switching the class library to /MTd solved this.
>
> I'm not sure what any of this has to do with STL though.
It was all STL functions that were being multiply defined (when I had the
wrong switches), but like I say is resolved now.
>
>> Now tell me, what the bloody hell is wrong with the MS way of doing
>> things, which is to provide documentation which says "include xxx.h,
>> link with yyy.lib". I really hope the designers of the STL weren't
>> glib enough to think that people would be so inept as to fail to work
>> out why their project wouldn't build when they hadn't added the STL
>> libraries to linker input, and 'drift off and use someone else's
>> class library'? Idiots!
>
> Can you kindly point to a page in STL documentation that would instruct
> one to link against a .LIB file?
Exactly - there is none. It's obviously all done with #pragma lib (or more
precisely #pragma comment(lib,...) ) , but what I was initially saying was
that I'd rather have more control over the linking and have to add them to
the linker input manually rather than the compiler being told to do this
automatically by the STL headers.
.
- References:
- #pragma lib buggers everything up
- From: Bonj
- Re: #pragma lib buggers everything up
- From: Igor Tandetnik
- #pragma lib buggers everything up
- Prev by Date: Re: API export registry
- Next by Date: Re: API export registry
- Previous by thread: Re: #pragma lib buggers everything up
- Next by thread: Re: is there a LBN_CLICK message ?
- Index(es):
Relevant Pages
|