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 - pexdark

Pages: [1]
1
General / Re: How to link everything statically
« on: May 29, 2023, 05:26:01 pm »
Wrong linking order isn't it? It's supposed to be dependencies last (dependencies are listed in the link provided by hapax)
Oh, it worked!
You're right, all i had to do is assemble the dependencies in the right order:
g++ Shader.cpp -Iinclude -Llib -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lwinmm -lopengl32 -lgdi32 -lfreetype -o Shader.exe
And silly me was just about to compile all of sfml on my own to check if there's some kind of issue with compatibility...
Thank you both so much for the help! Aside from resolving my issue it also pushed me to do some research and learn how exactly the compiler works.

2
General / Re: How to link everything statically
« on: May 29, 2023, 04:19:47 pm »
I assume to define SFML_STATIC you just need to write #define SFML_STATIC at the beginning of the file.
Also i checked the entire list and sorted the libraries, so now the command looks like this:
g++ Shader.cpp -Iinclude -Llib -lwinmm -lsfml-system-s -lopengl32 -lgdi32 -lsfml-window-s -lfreetype -lsfml-graphics-s -o Shader.exe

When i try launching the command i get errors like these:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: lib/libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x461): undefined reference to `sf::err()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: lib/libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x631): undefined reference to `sf::err()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: lib/libsfml-window-s.a(Window.cpp.obj):Window.cpp:(.text+0x761): undefined reference to `sf::err()'

i guess that's some progress?

3
General / How to link everything statically
« on: May 29, 2023, 03:57:05 pm »
Hi! I wanted to create an app that would use as few files as possible. I know i should use static linking, but i'm not sure how to do so. For the sake of simplicity, i'm using as little of additional software as i can - that means i'm launching the app directly from console.

So far i was using a command like this:
g++ Shader.cpp -Iinclude -Llib -lsfml-graphics -lsfml-window -lsfml-system -lwinmm -lopengl32 -lgdi32 -o Shader.exe
where "include" and "lib" are the folder names, and i use the "Shader.cpp" file from the examples.

However when i try the same setup with a command like this:
g++ Shader.cpp -Iinclude -Llib -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32 -o Shader.exe
it throws a bunch of errors like these:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\<username>\AppData\Local\Temp\ccjZLZ16.o:Shader.cpp:(.text+0x8c): undefined reference to `__imp__ZN2sf6StringC1EPKcRKSt6locale&#39;

I should also mention i'm using MinGW, and my only expirience with cpp is making cmd applications.

Pages: [1]
anything