[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problems linking agains a shared library - maybe [OT] ?
- To: Oded Arbel <odeda-linux-il(at-nospam)betalfa.org.il>
- Subject: Re: problems linking agains a shared library - maybe [OT] ?
- From: Behdad Esfahbod <behdad(at-nospam)bamdad.org>
- Date: Mon, 16 Jul 2001 22:49:04 +0430 (IRST)
- cc: Linux-IL mailing list <linux-il(at-nospam)cs.huji.ac.il>
- In-Reply-To: <019c01c10e24$b0690a50$2900000a@oded>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
Hi,
I have had the problem with fribidi library [that I'm a developer
myself!] several times, and all the times the problem was that It was
linking with an old version of library installed by gtk-fribidi rpm,
the other time, I updated the library, but it was including wrong
header files, ...
Yours,
Behdad
On Mon, 16 Jul 2001, Oded Arbel wrote:
> 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
>
--
Behdad
25 Tir 1380, 2001 Jul 16
[Finger for Geek Code]
=================================================================
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