Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tom42

Pages: [1]
1
General / Re: Cant Compile With Static libs.
« on: January 30, 2021, 01:08:49 pm »
I managed to figure it out. Thanks everyone! :)
This worked:
g++ -std=c++20 -DSFML_STATIC -O2 -no-pie -fno-pie -I/home/uzzer/LIB/SFML-2.5.1/include -o main main.cpp -L/home/uzzer/LIB/SFML-2.5.1/lib -L/usr/lib/x86_64-linux-gnu -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lGLU -lGL -lX11 -lXrandr -ludev -lpthread

*a bit confusing nonetheless.

2
General / Re: Cant Compile With Static libs.
« on: January 22, 2021, 04:10:36 pm »
...I thought SFML needs GLFW, so I added it.

g++ -DSFML_STATIC -O2 -no-pie -fno-pie -I/home/uzzer/LIB/SFML-2.5.1/include -o main main.cpp -L/home/uzzer/LIB/SFML-2.5.1/lib -L/usr/lib/x86_64-linux-gnu -pthread -ludev -lX11 -lsfml-graphics-s -lsfml-system-s -lsfml-window-s -lGL -lGLU -lstdc++ -lc -lm -ldl
/usr/bin/ld: /home/uzzer/LIB/SFML-2.5.1/lib/libsfml-window-s.a(ClipboardImpl.cpp.o): undefined reference to symbol 'XConvertSelection'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libX11.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
... my head hurts.

3
General / Re: Cant Compile With Static libs.
« on: January 22, 2021, 03:42:38 pm »
Thank you. But how can I know what depends on what?
When I change the order, I get this:
g++ -DSFML_STATIC -O2 -no-pie -fno-pie -I/home/uzzer/LIB/SFML-2.5.1/include -o main main.cpp -L/home/uzzer/LIB/SFML-2.5.1/lib -L/usr/lib/x86_64-linux-gnu -lsfml-graphics-s -lsfml-system-s -lsfml-window-s -lstdc++ -lc -lm -ldl -ludev -lX11 -lglfw -lGL -lGLU
/usr/bin/ld: /home/uzzer/LIB/SFML-2.5.1/lib/libsfml-system-s.a(MutexImpl.cpp.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

So, I need to use this https://www.sfml-dev.org/tutorials/2.4/start-vc.php and put Dependencies before static modules that requires it?

4
General / [SOLVED] Can't Compile With Static libs.
« on: January 22, 2021, 12:37:39 pm »
Hello everyone.
I'm trying to compile my silly hello-world SFML project for test. But getting strange error messages from linker. (When I compile with shared lib's - everything is OK.)

Also left this question & details here -> https://stackoverflow.com/questions/65830743/sfml-compilation-with-static-libs-error-c
Full error message is here. https://anotepad.com/notes/b34xbc2s

I don't  know what to do\read\learn about this, newer build anything with static libs before. I'm clearly doing something stupid here.

Pages: [1]