🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

statically link curl on Ubuntu

Started by
11 comments, last by MikeCyber 3 years, 10 months ago

Hi

I do:

g++ -L/usr/lib/x86_64-linux-gnu/libfreetype.a -L/usr/lib/x86_64-linux-gnu/libcurl.a -m64 -static-libgcc -DCURL_STATICLIB -I/usr/lib/x86_64-linux-gnu/libcurl.a -Wl,--version-script=exports.txt -shared -o "lin.xpl" ./BitmapSupport.o ./fontmgr.o ./image.o ./main.o ./myList.o ./rain.o ./shader.o -lGL -lGLEW

and get the runtime error:

dlerror:/home/michael/xplane/aircarft/plugin/lin.xpl: undefined symbol: curl_easy_perform

Many thanks for help

Advertisement

-L is not doing what you think it is. -l isn't used for linking, and also doesn't take a file.

So what to do?

Read the manual: https://gcc.gnu.org/onlinedocs/

I guess I need to compile curl myself without any dependencies.

Alberth said:

-L is not doing what you think it is. -l isn't used for linking, and also doesn't take a file.

Am I missing something? -l is most definitely used when linking: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options

Alberth said:

Read the manual: https://gcc.gnu.org/onlinedocs/

Here is a page concerning command line arguments for gcc: https://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html

if I add -lGL -lGLEW -lfreetype -lcurl Eclipse uses the shared libs not the static. What to do? Thanks

MikeCyber said:

if I add -lGL -lGLEW -lfreetype -lcurl Eclipse uses the shared libs not the static. What to do? Thanks

Have you compiled GLEW freetype and curl into static libraries first?

Yes except freetpye. With the below I get a curl runtime error and for the others are shared not static libs used.

Invoking: GCC C++ Linker

g++ -L/home/michael/eclipse-workspace/curl-7.72.0/lib/.libs/libcurl.a -Lhome/michael/eclipse-workspace/glew-2.1.0/lib/libGLEW.a -L/usr/lib/x86_64-linux-gnu/libfreetype.a -DCURL_STATICLIB -Wl,-Bstatic -I:/home/michael/eclipse-workspace/curl-7.72.0/lib/.libs/libcurl.a -DGLEW_STATIC -Wl,-Bstatic -I:/home/michael/eclipse-workspace/glew-2.1.0/lib/libGLEW.a -fPIC -fvisibility=hidden -shared -Wl,-Bdynamic -shared -o "lin.xpl" ./BitmapSupport.o ./fontmgr.o ./image.o ./main.o ./myList.o ./rain.o ./shader.o -lGL -lGLEW -lfreetype

Finished building target: lin.xpl

SuperVGA said:
Am I missing something? -l is most definitely used when linking: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options​

lowecrase ell yes, the OP however uses uppercase I which his for finding include files. The font is broken here, see the image I took after copy/pasting some text to my computer.

This topic is closed to new replies.

Advertisement