[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problems linking agains a shared library - maybe [OT] ?
- To: "Linux-IL mailing list" <linux-il(at-nospam)cs.huji.ac.il>
- Subject: problems linking agains a shared library - maybe [OT] ?
- From: "Oded Arbel" <odeda-linux-il(at-nospam)betalfa.org.il>
- Date: Mon, 16 Jul 2001 20:24:00 +0200
- Organization: mailgw.netvision.net.il
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
Hi list !
I'm trying to use a file transfer library called libFerit
(http://www.mindspring.com/~darkskye/projects/ferit.html). it has an obscure
build process, which ends putting a .so file in /usr/lib and some header
files in /usr/include/ferit.
so I wrote this simple program to test the library :
#include <ferit/Http.h>
int main(int argc, char *argv[])
{
Http* http = new Http(10);
//Url* url = new Url("http://www.cnn.com");
Url* url = new Url("");
url->UrlToSession("http://www.cnn.com");
url->Options(OPT_PROGRESS | OPT_RESUME);
url->Outfile("index.html");
url->Print();
if (http)
printf("Error status %i\n", http->Download(url, NULL));
else printf("Error !\n");
return EXIT_SUCCESS;
}
compiled and linked it :
gcc -o test main.cpp -lferit
now, when I try to run it (from the command line) it segfaults immidietly.
when run through gdb (with no break points) it segfaults in another place.
when run through gdb with a break point somewhere at the start (stoping at
the break point and then continue to the end), or using some gdb front end,
it runs properly w/o a flaw. when I tried to trace it using KDevelops gdb
front end (where I first encountered the problem) it crashes when doing
'gethostbyname', but deep down in some obscure part of libc, where I see all
kinds of functions on the stack that have names that start with _dl_.
from all this I guess this is some sort of linking problem because of using
a linking paradigm I'm not aware of.
I've already emailed the author of the library, and he couldn't help me
except offer some syntax corrections (the commented line was replaced by the
two lines after it).
the wierd thing is that the library comes with a program that links against
it and used as a simple client. the simple test above is actually made up of
selected code lines from this client programs main function. this client
binary is also being built in a similar matter - but it always runs with no
problems.
I'm not sure what to do, since all the shared libraries I've built and used
so far where using libtool which looks completly different..
help ?
Oded
--
There are three kinds of lies - lies, damn lies, and statistics.
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il