This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building dlls with cygwin


Volker

help netmsg 127
gives:
The specified procedure could not be found.

This means that your dll was loaded correctly, but did not contain the symbol passed to dlsym().
I have built many (dozens) of dll modules for gnome on cygwin, and no special commands or linker
switches were necessary; no import library is needed either. Are you sure that your dll actually
exports the required symbol (try using nm --defined-only DLL | grep SYMBOL)
Steven

(PS apologies for the previous empty reply - itchy fingers on webmail!)

Original Message:
Hi!

I wanted to implement some loadable extensions for gnupg.

Cygwin gpg can already use loadable modules with the --load-extension swich,
you can test this with the dll found in this archive:
  http://disastry.dhs.org/pgp/gpg/ideadll.zip
The source is here:
  http://disastry.dhs.org/pgp/gpg/ideadllsrc.zip.

This dll is compiled with MSVC, I thought I can compile it with gcc and
followed the instructions in Chuck's dllhelpers (The makefile in C) and
used the following script:
---
#
# Building DLLs with Cygwin for gnupg
#

CC=gcc
DEBUG=" -g -Wall"
CFLAGS=$DEBUG
CPPFLAGS="-I."

DLL_NAME="idea.dll"
DLL_EXP_LIB="libidea.dll.a"
DLL_EXP_DEF="libidea.def"

DLL_LDFLAGS="-Wl,--export-all-symbols"
## any extra libraries that your DLL may depend on.
## build in gnupg-1.0.7/cipher
DLL_LDLIBS="../cipher/libcipher.a ../util/libutil.a  -lintl"

## Building .o
$CC -c $CPPFLAGS $CFLAGS -o idea.o idea.c

## Making DLL
gcc -shared -Wl,--out-implib=$DLL_EXP_LIB -o $DLL_NAME idea.o $DLL_LDLIBS $DLL_LDFLAGS

## making exec
# is already made!
---

The dll build without problem, but when I try to use it I get a dlsym: Win32 error 127.

OK, I didn't build gpg with the import library (but it works with the MSVC build
dll), but this is different from the dllhelpers example. Gpg uses dlopen() to load
the module and then the dlsym() fails with the cygwin build dll.

(Yes, I know the msvc sources contain a "g10_log.c", I tried to build the dll without
$DLL_LDLIBS but with g10_log.o. You get a dll, but it also doesn't work.)

Did I miss something? (Sure, what?)

Any help is apreciated, I'd like to get this feature working in gnupg.

Bye
   Volker




--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]