|
From: Danny S. <dan...@cl...> - 2005-06-28 20:47:47
|
=46rom: "ernesto basc=F3n pantoja"
> Hi everybody:
>
>
> I am writing this very small test class using mingw:
>
>
> #ifdef DLL
> #define DLLEXPORT __declspec(dllexport)
> #else
> #define DLLEXPORT __declspec(dllimport)
> #endif
>
>
> #include <stdio.h>
>
>
> class DLLEXPORT MyTestClass
> {
> public:
> MyTestClass() { }
> ~MyTestClass() { }
> int GetSuccessor(int a) { return a + 1; }
> int GetPredecessor(int a) { return a - 1; }
>
>
>
> };
>
>
>
> As you can see, I want to export that class into a DLL.
> So, I do:
>
> g++ -shared -o test.dll test.cpp -Wl,-output-def=3Dtest.def -DDLL
>
>
> and my DLL is an empty DLL with no exported symbols!!! (and the .de=
f
> file has length 0).
>
The functions are all inline. Either move the definitions out of the=
class
definition or add -fkeep-inline-functions to command line.
Danny
>
> Am I doing something wrong? I am creating a C++ library, and I want=
to
> export only classes into my DLL.
>
>
> Thanks in advance
>
>
> Ernesto
>
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strateg=
ies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=
=3Dclick
> _______________________________________________
> MinGW-users mailing list
> Min...@li...
>
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
|