[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: global_symbol_pipe not picking up an initialized globalvariable with
RE: global_symbol_pipe not picking up an initialized globalvariable with msvc
Mon, 17 Aug 2009 09:51:09 -0700
> > UTL_EXPORT becomes __declspec(dllexport) when compiling
> > the shared lib, __declspec(dllimport) when compiling the
> > executable that uses it.
> did you double check if that really works on both sides?
> your problem sound to me as if dllimport is missing
Not enough. I checked this once more and the dllimport was missing. When I
jimmy around the definition of UTL_EXPORT, I can make this problem
disappear. When UTL_EXPORT is empty I get this error. When it's defined as
__declspec(dllimport), utils-test links fine.
> shouldn't that be looking for __imp_optopt, etc? i guess
> you do try to link against a shared lib?
When I'm linking against a shared lib, this works. If I'm linking against a
static lib, UTL_EXPORT needs to be empty or I get errors like this:
unresolved external symbol __imp__optopt
There's another thread about how to define UTL_EXPORT properly so I'll
respond there about how to handle this. It feels like I want a compiler
flag to depend on the kind of library found at link time...problematic.
Thanks for your help.