Bochs/bochs-testing/plugin-test/test7-win32dll
2002-10-14 21:06:47 +00:00
..
main.cc - change main.cc to use LoadLibrary/GetProcAddress instead of ltdl library 2002-10-14 20:43:33 +00:00
main.h - change main.cc to use LoadLibrary/GetProcAddress instead of ltdl library 2002-10-14 20:43:33 +00:00
Makefile.in - test7-win32dll began life as an exact copy of test6-ltdlopen. This 2002-10-14 20:34:13 +00:00
Makefile.vc - add makefile for VC++ 2002-10-14 20:44:02 +00:00
module1.cc - add reference to version_string so that we test exports of variables too 2002-10-14 20:42:46 +00:00
module2.cc - add reference to version_string so that we test exports of variables too 2002-10-14 20:42:46 +00:00
README - update for test7-win32dll 2002-10-14 21:06:47 +00:00

test7-win32dll

This is similar to test6, but Psyon helped me port the main.cc code to
use LoadLibrary/GetProcAddress and make a Makefile that actually works.






I found that even for a trivial example I cannot make a working executable
with main in a DLL.  Try making libmain a static library.  But then would
every module link in all the code, or still use an implementation lib?


Standard build:
/bin/sh.exe ../libtool g++ -mno-cygwin  -g -c main.cc
/bin/sh.exe ../libtool g++ -mno-cygwin -no-undefined -g -o libmain.la main.lo -rpath `pwd`/lib 
mkdir -p lib bin
/bin/sh.exe ../libtool cp libmain.la `pwd`/lib
/bin/sh.exe ../libtool g++ -mno-cygwin -no-undefined -g -o uselib libmain.la 
/bin/sh.exe ../libtool g++ -mno-cygwin  -g -c module1.cc
/bin/sh.exe ../libtool g++ -mno-cygwin -no-undefined -g -o libmodule1.la module1.lo -rpath `pwd`/lib libmain.la
mkdir -p lib bin
/bin/sh.exe ../libtool cp libmodule1.la `pwd`/lib
/bin/sh.exe ../libtool g++ -mno-cygwin  -g -c module2.cc
/bin/sh.exe ../libtool g++ -mno-cygwin -no-undefined -g -o libmodule2.la module2.lo -rpath `pwd`/lib libmain.la
mkdir -p lib bin
/bin/sh.exe ../libtool cp libmodule2.la `pwd`/lib

Try with libmain as a static lib.
/bin/sh.exe ../libtool g++ -ggdb -mno-cygwin  -g -c main.cc
/bin/sh.exe ../libtool g++ -ggdb -mno-cygwin -no-undefined -g -o libmain.la main.lo 
mkdir -p lib bin
/bin/sh.exe ../libtool cp libmain.la `pwd`/lib
/bin/sh.exe ../libtool g++ -ggdb -mno-cygwin -no-undefined -g -o uselib libmain.la 
/bin/sh.exe ../libtool g++ -ggdb -mno-cygwin  -g -c module1.cc
/bin/sh.exe ../libtool g++ -ggdb -mno-cygwin -no-undefined -g -o libmodule1.la module1.lo -rpath `pwd`/lib libmain.la
mkdir -p lib bin
/bin/sh.exe ../libtool cp libmodule1.la `pwd`/lib
/bin/sh.exe ../libtool g++ -ggdb -mno-cygwin  -g -c module2.cc
/bin/sh.exe ../libtool g++ -ggdb -mno-cygwin -no-undefined -g -o libmodule2.la module2.lo -rpath `pwd`/lib libmain.la
mkdir -p lib bin
/bin/sh.exe ../libtool cp libmodule2.la `pwd`/lib



How to make an import library for cygmodule2-0.dll
dlltool --as=as --dllname cygmodule2-0.dll --def .libs/cygmodule2-0.dll-def --output-lib .libs/libimp-cygmodule2-0.a

dll-def file is:
EXPORTS
 module_init @ 1 ; 
 n_operations @ 2 DATA ; 
 operate__Fii @ 3 ;