Menu

Make dynamic DLL with Glee ?

2010-07-07
2013-05-23
  • Jose Maria Gregoris

    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

     
  •  alatnet

    alatnet - 2010-08-06

    The problem you have is that you didnt export any functions to the dll file.

    #ifdef BUILD_DLL
        #define DLL_DECLARE __declspec(dllexport)
    #else
        #define DLL_DECLARE __declspec(dllimport)
    #endif
    

    Use that to export and import stuff from the dll file.
    Add DLL_DECLARE to the start of every function after it's type (e.g. void, int, float, etc…).
    Build using -DBUILD_DLL command when compiling NOT linking and it'll automatically create a proper dll.
    When trying to use the dll in your project, all you have to do is import the .h or .hpp file of the dll and dont add -DBUILD_DLL.
    You will be able to use your dll in your project without any problems.

     

Log in to post a comment.