Static variable in dll cannot be auto-imported in release, but can in debug version

Zahroof Mohamed zahroofm@gmail.com
Sun Feb 6 12:11:00 GMT 2005


Hi,

I'm new to this group. Couldn't find information regarding this topic
and wondered whether anyone had any pointers.

I'm using gcc3.4.3 with Win 2K. Parinya software's MinGW Developer
Studio as the IDE.

I've written a program in C++ that has global variables (object
factories) stored in dlls. However, when I try to build this program,
the debug version builds alright but the release version bombs because
it says it can't auto-import the variable. Here is an example case
that shows this.

--------------------Configuration: Refrigerant - Debug--------------------
Compiling source file(s)...
Refrigerant.cpp
Linking...
Info: resolving ZAPP::CZObj::ZObjFactory      by linking to
__imp___ZN4ZAPP5CZObj11ZObjFactoryE (auto-import)
Info: resolving _cinput_ by linking to __imp__cinput_ (auto-import)
Creating library file:
C:\Zahroof\EAZ\ZObj\Refrigerant\Debug\libRefrigerant.dll.a

Refrigerant.dll - 0 error(s), 0 warning(s)

--------------------Configuration: Refrigerant - Release--------------------
Compiling source file(s)...
Refrigerant.cpp
Linking...
Info: resolving _cinput_ by linking to __imp__cinput_ (auto-import)
Info: resolving ZAPP::CZObj::ZObjFactory      by linking to
__imp___ZN4ZAPP5CZObj11ZObjFactoryE (auto-import)
C:\Zahroof\EAZ\ZObj\Refrigerant\Release\Refrigerant.o(.text+0xc721):Refrigerant.cpp:
variable 'ZAPP::CZObj::ZObjFactory' can't be auto-imported. Please
read the documentation for ld's --enable-auto-import for details.
C:\Zahroof\EAZ\ZObj\Refrigerant\Release\Refrigerant.o(.text+0xc748):Refrigerant.cpp:
variable 'ZAPP::CZObj::ZObjFactory' can't be auto-imported. Please
read the documentation for ld's --enable-auto-import for details.
Creating library file:
C:\Zahroof\EAZ\ZObj\Refrigerant\Release\libRefrigerant.dll.a
collect2: ld returned 1 exit status

Refrigerant.dll - 0 error(s), 0 warning(s)


Help, please.

Zahroof M



More information about the Gcc-help mailing list