Subject: RE: Symbol in DLL begin with _
From: "Pasch, Thomas (ACTGRO)" <[email-masked]>
To: "'Dmitry Timoshkov'" <[email-masked]>, "Pasch, Thomas (ACTGRO)" <[email-masked]>
Cc: [email-masked]
Date: Tue, 31 Jul 2001 15:49:06 +0200

Well, 

Apparently you don't use stdcall (WINAPI) decorated function names.
In that case all that magic with -k,--kill-at,--enable-stdcall-fixup,
--add-stdcall-alias can be completely eliminated.

You are right, no stdcall or MS Windows calls at the moment,
only plain Standard C++.

You are wrong. I could use the attached script as
well. But it will not work without ---add-stdcall-alias
on my NT 4.0 system.

Cheers,

Thomas

-----------------------------------------------------

#!/bin/bash

# mkdll.sh LIBNAME OBJECTFILES
# LIBNAME: without extensions
# OBJECTFILES: *.o (with extensions)

if test $# -lt 2; then 
  echo "usage: mkdll.sh LIBNAME OBJECTS*"
  exit -1
fi
	
# additional libs to link with: here we are doing C++ stuff
export LIBS=-lstdc++
export LIBNAME=$1
shift

# based on a tip of Dmitry Timoshkov
# zero, remove old dll
rm $LIBNAME.a $LIBNAME.dll $LIBNAME.def $LIBNAME.tmp 2>/dev/null
# first, get a EXPORT list
dlltool --add-stdcall-alias --export-all-symbols --output-def $LIBNAME.tmp
$*
# (JNI only): second, only let the 'Java_' symbols in
echo EXPORTS >$LIBNAME.def
grep "Java_" $LIBNAME.tmp >>$LIBNAME.def
# third, create the .dll
dllwrap -o $LIBNAME.dll $* $LIBS --def $LIBNAME.def -Wl
# forth, reorganize the .a lib
dlltool --input-def $LIBNAME.def --output-lib lib$LIBNAME.a
# fifth, echo something helpful about the dependencies of the dll
cygcheck -rv $LIBNAME.dll

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/