This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: Problems using a DLL created with GNU from Microsoft VC++
- To: "'cygwin at sourceware dot cygnus dot com'" <cygwin at sourceware dot cygnus dot com>
- Subject: Re: Problems using a DLL created with GNU from Microsoft VC++
- From: "Kenneth Sandberg (ERA)" <Kenneth dot Sandberg at era dot ericsson dot se>
- Date: Wed, 9 Aug 2000 07:44:03 +0200
I have used the unix/gnu/posix functions in cygwin to compile the code. Following
script have been used to compile the code:
#! /bin/sh
# Example Script to compile and link a relocatable DLL
# Files that make up the DLL = foo.c foo2.c init.cc fixup.c
# (init.cc and fixup.c are housekeeping routines needed for the DLL. The actual
# library routines are in foo.c and foo2.c)
# ***Fill in your path to libcygwin.a here (with ni trailing slash)***
LIBPATH=/lib
# Compile source files:
g++ -c foo.c
g++ -c foo2.c
g++ -c init.cc
g++ -c fixup.c
# Make .def file
echo EXPORTS > fooB.def
nm foo.o foo2.o init.o fixup.o | grep '^........ [T] _' | sed 's/[^_]*_//' >> fooB.def
# Link DLL
ld --base-file fooB.base -dll -o fooB.dll foo.o foo2.o init.o fixup.o \
/lib/libcygwin.a -e _dll_entry@12
dlltool --as=as --dllname fooB.dll --def fooB.def --base-file fooB.base --output-exp fooB.exp
ld --base-file fooB.base fooB.exp -dll -o fooB.dll foo.o foo2.o init.o fixup.o \
/lib/libcygwin.a -e _dll_entry@12
dlltool --as=as --dllname fooB.dll --def fooB.def --base-file fooB.base --output-exp fooB.exp
ld fooB.exp -dll -o fooB.dll foo.o foo2.o init.o fixup.o\
/lib/libcygwin.a -e _dll_entry@12
# Build the fooB.a lib to link to:
dlltool --as=as --dllname fooB.dll --def fooB.def --output-lib fooB.a
# Linking with main
g++ main3.c -o main3.exe
Kenneth Sandberg
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com