[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnucap-devel] Re: mingw DLL problem
From: |
al davis |
Subject: |
Re: [Gnucap-devel] Re: mingw DLL problem |
Date: |
Sun, 4 Nov 2007 02:12:03 -0400 |
User-agent: |
KMail/1.9.7 |
On Saturday 03 November 2007, Cesar Strauss wrote:
> It worked for me, with some adjustments. See the attached
> tarball. The files I modified were interface.h (export
> desired symbols) and the Makefile (create and use an "import
> library").
The list removes non-text attachments. Here are interface.h and
Makefile, from Cesar's tarball.
Try it again.......
=======interface.h==================
#if defined(__MINGW32__)
# ifdef BUILDING_AOUT
# define AOUT_EXTERN extern __declspec(dllexport)
# else
# define AOUT_EXTERN extern __declspec(dllimport)
# endif
#else
# define AOUT_EXTERN extern
#endif
struct THING {
virtual int stuff() = 0;
};
AOUT_EXTERN int bar();
AOUT_EXTERN THING* x;
===========Makefile===========
all: a.out.exe my_dll.dll my_other_dll.dll
a.out.exe : main.o
g++ -o a.out.exe main.o
main.o : main.cc interface.h
g++ -c main.cc -DBUILDING_AOUT -o main.o
libaout.a: main.o
dlltool -l libaout.a -D a.out.exe main.o
my_dll.dll : my_dll.cc interface.h libaout.a
g++ -shared my_dll.cc -L. -laout -o my_dll.dll
my_other_dll.dll : my_other_dll.cc interface.h libaout.a
g++ -shared my_other_dll.cc -L. -laout -o
my_other_dll.dll
clean:
rm -f *.o *.a *.exe *.dll