C++ Classes in Shared Libraries - Questions

This is a discussion on C++ Classes in Shared Libraries - Questions ; Are there any problems exporting C++ classes from shared libraries? Under some operating systems, it is necessary to tag exported classes in special ways to make them accessible in shared libraries. Are there any such constructs necessary under Linux (we're ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: C++ Classes in Shared Libraries

  1. C++ Classes in Shared Libraries

    Are there any problems exporting C++ classes from shared libraries? Under
    some operating systems, it is necessary to tag exported classes in special
    ways to make them accessible in shared libraries. Are there any such
    constructs necessary under Linux (we're using Redhat 9, with g++).

    Thanks,

    -- dwa



  2. Re: C++ Classes in Shared Libraries

    Hy!

    I am using the following Code for Solaris/Windows:

    #if defined (WIN32)
    //For Windows
    #ifdef MAKEDLL_ReadLibrary
    #define DLLEXP_ReadLibrary __declspec(dllexport)
    #else
    #define DLLEXP_ReadLibrary __declspec(dllimport)
    #endif

    #elif defined (OS_LINUX) || defined (OS_FREEBSD) || defined (OS_SOLARIS)
    //Linux doesnīt need a dllexport or dllimport
    #ifdef MAKEDLL_ReadLibrary
    #define DLLEXP_ReadLibrary
    #else
    #define DLLEXP_ReadLibrary
    #endif

    #endif

    #endif

    Means you donīt have to do anything to export the classes under Solaris.


    "da" schrieb im Newsbeitrag
    news:JffKc.25662$Kz3.2513628@news4.srv.hcvlny.cv.n et...
    > Are there any problems exporting C++ classes from shared libraries?

    Under
    > some operating systems, it is necessary to tag exported classes in special
    > ways to make them accessible in shared libraries. Are there any such
    > constructs necessary under Linux (we're using Redhat 9, with g++).
    >
    > Thanks,
    >
    > -- dwa
    >
    >




+ Reply to Thread