user1018513
user1018513

Reputation: 1682

Linking Error C++ Libcurl

I am trying to run the following g++ command

gcc client.cc -o client -I$(CURRENTPATH)/curl-7.38.0/include/ -L$(CURRENTPATH)/lib/libcurl.so -lcurl

but get this error:

/usr/bin/ld: cannot find -lcurl collect2: ld returned 1 exit status

libcurl.so is located in ./lib I've tried with libcurl.so and lib/libcurl.so.4 and lib/libcurl.so.4.3.0 but always get the same error.

I do not have access to /usr

I've also set my LD_LIBRARY_PATH to include ./lib (full path)

Any ideas?

My understanding is that -L specifies non-traditional paths to libraries, and that LD_LIBRARY_PATH determines where the compiler will look for them.

Upvotes: 0

Views: 460

Answers (1)

user1018513
user1018513

Reputation: 1682

-L takes a path rather than a specific library

Upvotes: 2

Related Questions