This is the mail archive of the
mailing list for the Cygwin project.
Problem with dlsym against libicu
- From: Sam Habiel <sam dot habiel at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 22 Jan 2016 19:49:34 -0800
- Subject: Problem with dlsym against libicu
- Authentication-results: sourceware.org; auth=none
I am porting GT.M
(https://www.fisglobal.com/Solutions/Services/Database-Engine) to run
on Cygwin x86. My changes are here:
https://github.com/shabiel/fis-gtm/. GT.M is used in healthcare and
banking; I happen to work in the former field.
The problem I am having is that GT.M opens libicuio via dlopen, and
then loads the function pointers into a data structure via function
name using dlsym. For the curious, the code is in gtm_icu_init() in
I took me a while, but I eventually figured out that dlls that are
opened via dlopen need to be in the PATH in Cygwin. I saw this in an
earlier Cygwin mailing list message.
However, no matter what I do, I can't seem to get a non-null reference
to a named symbol in libicuio via dlsym. Here's what I tried:
0. nm shows the symbols in the file I want to open; strace shows me
opening it (it's /usr/lib/cygicuio56.dll).
1. Compiled libicu from source with a flag for Cygwin:
2. Used underscores in front of the symbol
3. Tried creating an import library using the instructions at
https://cygwin.com/cygwin-ug-net/dll.html#dll-build at the bottom and
then add the archive to the gcc compile command as a source file.
(These instructions need to be improved! I had no idea what to do with
a .a file after I got it).
Here's a test program that I have written. Note that dlsym returns the
obscure error message "no such process", which doesn't make any sense
to me, as I am not looking for a "process" but a symbol.
$ cat test.c
int main (int arg, char **argv)
void *ptr = dlopen("cygicuio.dll", RTLD_LAZY);
if (ptr != NULL)
void *ptr2 = dlsym(ptr,"uset_open");
if (ptr2 != NULL)
$ gcc -Wall -otest.o test.c
No such file or directory
$ PATH=/usr/lib:/usr/bin:/usr/local/bin:. ./test.o
No such process
Sam Habiel, Pharm.D.
VISTA Expertise Network
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple