Statically Link Sdl

Started by
4 comments, last by FGFS 7 years, 8 months ago

Hi

I do with Eclipse on Ubuntu:

Invoking: GCC C++ Linker
g++ -Wl,-Bstatic -lSDL -Wl,-Bdynamic,-rpath=. -shared -o "lin.xpl" ./main.o ./myList.o -lopenal -lcurl -lGL
Finished building target: lin.xpl

but get sdl errors. How to link statically sdl and later sdl_ttf for a X-Plane plugin.

Thanks

Advertisement

This may or may not help, but when I compile SDL2 on my Ubuntu Linux machine, I had to have the following options :

g++ -O3 -fPIC -std=c+11 -I/usr/lib -I/usr/include ..... (object files) .... -lX11 -lGL -lGLU -lGLEW -lSDL2 -lSDL2_image -lSDL2_mixer -o program.exe

Some of those are probably redunant (e.g. -fPIC) but I had 'fun' getting it working and just left everything in there when it finally worked! Might not help, but just in case...

but get sdl errors

What errors? We cannot read your mind, and so unless you provide the actual error text (actual error text, copy-and-pasted, don't re-write it from memory) there's not a whole lot anybody can do but guess.

@sergamer I use sdl1.2 and static linking

@Josh

I do with Eclipse on Ubuntu:

Invoking: GCC C++ Linker
g++ -Wl,-Bstatic -lSDL -Wl,-Bdynamic,-rpath=. -shared -o "lin.xpl" ./main.o ./myList.o -lopenal -lcurl -lGL
Finished building target: lin.xpl

without -lSDL at the end I get sdl-quit not found or alike errors. How to link statically sdl and later sdl_ttf for a X-Plane plugin.
Thanks

For Ubuntu dynamic linking is ok, but I don't want to ship sdl and sdl_ttf with my app on other os.

without -lSDL at the end I get sdl-quit not found or alike errors


the actual error text (actual error text, copy-and-pasted, don't re-write it from memory)

With:

Invoking: GCC C++ Linker
g++ -Wl,-Bstatic -lSDL -Wl,-Bdynamic,-rpath=. -shared -o "lin.xpl" ./main.o ./myList.o -lopenal -lcurl -lGL
Finished building target: lin.xpl

I get:

dlerror:/media/michael/DATA/X-Plane_10/Aircraft/General Aviation/P4/plugins/p4/64/lin.xpl: undefined symbol: SDL_Quit

Many thanks

This topic is closed to new replies.

Advertisement