简体   繁体   中英

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.

-L采用路径而不是特定的库

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM