[galib] Building GALib DLL: GAID is a problem!
Peter Jay Salzman
p at dirac.org
Fri Oct 26 14:20:27 EDT 2007
Hi all,
I've compiled a GALib DLL (which actually exports symbols), but so far, I've
not been able to *use* the DLL. However, there are 2 specific questions I'd
like to ask.
First Question:
I've placed "GA_DLLDECL" in every non-template class definition except
for "GAID". When I change this definition:
class GAID
{
...
to this:
class GA_DLLDECL GAID
{
...
I get the following compile time error:
gaid.h(30) : error C2470: 'GAID' :
looks like a function definition, but there is no parameter list;
skipping apparent body
I understand what the compiler is telling me. I just don't know how to
"fix" it, since it doesn't look like a parameterless function to me.
Second Question:
In the project settings, I use in Properties | C/C++ | Command Line:
/D "COMPILE_GALIB_AS_DLL"
/D "_CRT_SECURE_NO_DEPRECATE"
However, when I look in gaconfig.h at this code:
#if defined(COMPILE_GALIB_AS_DLL)
#define GA_DLLDECL __declspec(dllexport) <--- greyed out
#elif defined(USE_GALIB_AS_DLL)
#define GA_DLLDECL __declspec(dllimport) <--- greyed out
#else
#define GA_DLLDECL <--- colored
#endif
Because the 2nd line is greyed out and the 6th line is colored, it looks
like VC++ is not seeing my #define for COMPILE_GALIB_AS_DLL.
Furthermore, when I let the mouse hover over this line of code:
class GA_DLLDECL GAID
a box pops up saying "#define GA_DLLDECL", not "__declspec(dllexport)".
So it really really seems like VS is not seeing my #define.
I noticed many similar question in the archives, but the answers are either
non-applicable (I'm not using gcc) or else not correct (I'm already
compiling this as a C++ program).
Help?
Thanks!
Pete
More information about the galib
mailing list