PDA

View Full Version : Make dynamic DLL with Glee ?



kikoST
07-07-2010, 07:21 AM
Hi All

I'm working with smalltalk and openGL and I want to work with Glee.
From smalltalk, I only can work with dynamic DLL (not with static Lib).
I download the last glee.h and glee.C files(5.4).
Now I try to make the dynamic dll with visual studio 2005.

I'm not expert in C++

First: I make an window empty projecto.
Second: I select dll project .
Third: I add the glee.h and glee.c.
fourth: I add opengl32.lib like additional dependency.

finally: I compile the project.

The DLL is Ok.
The problem is that DLL doesn't export any functions !!!

Why ?
Any idea ?


advanced thanks

kiko

carsten neumann
07-07-2010, 10:42 AM
This question has not much to do with OpenGL, you are likely to get better answers if you ask on a forum dedicated to Windows development in general.

For a function to be exported from a DLL it has to be annotated with __declspec(dllexport) when building the DLL and with __declspec(dllimport) when using the DLL (i.e. from your app, may not be relevant to you since you are using the DLL from Smalltalk not C/C++, but I don't know much about that).
The usual way to achieve that is to define a macro like this:



#ifdef COMPILE_GLEE_SOURCE
#define GLEE_EXPORT __declspec(dllexport)
#else
#define GLEE_EXPORT __declspec(dllimport)
#endif


and use it in glee.h like



GLEE_EXPORT void someGleeFunction(void);


In your settings for building the DLL find the option that allows you to define additional preprocessor symbols on the compiler command line and add COMPILE_GLEE_SOURCE. That way when the DLL is built functions are marked as exported, but when using the DLL they are marked as imported instead.

kikoST
07-11-2010, 11:25 AM
Hi

Thanks , now it work

kiko