Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who's Online
2 user(s) are online (1 user(s) are browsing Forum)

Members: 1
Guests: 1

The_Reaper, more...

Browsing this Thread:   1 Anonymous Users





Linking a simple libcurl C Program

Joined:
1/20 18:36
From SF Bay Area, California
Group:
Member
Posts: 38
Offline
I'm trying to learn libcurl and I'm having trouble getting even simple file to link in AROS.

#include

int main()
{
curl_global_init(CURL_GLOBAL_ALL);
}

And when I compile with "gcc foo.c -lcurl -o foo" I'm hit with a list of undefined symbols like:

RAND_load_file
UI_method_method_closer
SSL_CTX_use_certificate
UI_method_get_reader
X509_load_crl_file

My first guess was to try also linking with -lssl but that didn't work either.

Is anyone able to set me on the right path?





Posted on: 3/13 21:56
Transfer the post to other applications Transfer


Re: Linking a simple libcurl C Program

Joined:
2009/10/28 4:25
From Finland
Group:
Member
Posts: 245
Offline
You probably need to link with -lcrypto instead of (or possibly as well as) -lssl.

Posted on: 3/14 2:53
Transfer the post to other applications Transfer


Re: Linking a simple libcurl C Program

Joined:
1/20 18:36
From SF Bay Area, California
Group:
Member
Posts: 38
Offline
That helped, thanks!

Through a little trial and error I discovered I needed "gcc foo.c -lcurl -lssl -lcrypto -lz -o foo".

Is there a better process than trial and error to find which libs to link?

Posted on: 3/14 8:09
Transfer the post to other applications Transfer


Re: Linking a simple libcurl C Program

Joined:
2004/10/30 17:13
From Ireland
Group:
Member
Posts: 2794
Offline
Quote:

remotenemesis wrote:

Is there a better process than trial and error to find which libs to link?


Google the missing symbols?

Posted on: 3/16 12:07
Transfer the post to other applications Transfer


Re: Linking a simple libcurl C Program

Joined:
2009/10/28 4:25
From Finland
Group:
Member
Posts: 245
Offline
@remotenemesis

You could use something like:

i386-aros-readelf -s <static library> | grep <symbol>

or:

i386-aros-objdump -t <static library> | grep <symbol>

To check if a library defines the symbol.

Posted on: 3/16 13:02
Transfer the post to other applications Transfer


Re: Linking a simple libcurl C Program

Joined:
1/20 18:36
From SF Bay Area, California
Group:
Member
Posts: 38
Offline
@salass00 that is helpful, thank you.

@ncafferkey that's pretty much my day job too...

Cheers!


Posted on: 3/17 10:33
Transfer the post to other applications Transfer






You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4427
2 magorium
magorium
4095
3 nikolaos
nikolaos
4010
4 phoenixkonsole
phoenixkonsole
3921
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2794
7 mazze
mazze
2221
8 clusteruk
clusteruk
2112
9 damocles
damocles
1789
10 BSzili
BSzili
1511
© 2004-2018 AROS Exec