SFML community forums

Help => General => Topic started by: AnselmeSfml on July 04, 2017, 02:27:53 pm

Title: SFML static : window won't open
Post by: AnselmeSfml on July 04, 2017, 02:27:53 pm
Hello !  :D

I built my application with SFML statically linked on Windows. There were no problems during compilation.
But when I launch my application, my window does not appear. The only thing that appears is the Windows's terminal.

I worked on my project on Linux so when I had to build for Windows, I installed on my Windows computer a standalone version of the "make" command.

Here is the makefile :

CXXFLAGS = -DSFML_STATIC -std=c++14 -c -ISFML/include/
SFMLLIB = -LSFML/lib/ -lsfml-graphics-s -lsfml-window-s -lsfml-audio-s -lsfml-system-s -lopenal32 -lvorbisfile -lvorbisenc -lvorbis -logg -lFLAC -ljpeg -lfreetype -lgdi32 -lopengl32 -lwinmm

OBJECTS = main.o Snake.o Inputs.o FoodPoints.o Point.o Random.o SoundSystem.o TileBackground.o ScoreSystem.o Gui.o

CCXX = g++

all : $(OBJECTS)
        $(CCXX) $(OBJECTS) $(SFMLLIB) -o snake

main.o : src/main.cpp
        $(CCXX) $(CXXFLAGS) src/main.cpp

Snake.o : src/Snake.cpp
        $(CCXX) $(CXXFLAGS) src/Snake.cpp

Inputs.o : src/Inputs.cpp
        $(CCXX) $(CXXFLAGS) src/Inputs.cpp

FoodPoints.o : src/FoodPoints.cpp
        $(CCXX) $(CXXFLAGS) src/FoodPoints.cpp

Point.o : src/Point.cpp
        $(CCXX) $(CXXFLAGS) src/Point.cpp

Random.o : src/Random.cpp
        $(CCXX) $(CXXFLAGS) src/Random.cpp

SoundSystem.o : src/SoundSystem.cpp
        $(CCXX) $(CXXFLAGS) src/SoundSystem.cpp

TileBackground.o : src/TileBackground.cpp
        $(CCXX) $(CXXFLAGS) src/TileBackground.cpp

ScoreSystem.o : src/ScoreSystem.cpp
        $(CCXX) $(CXXFLAGS) src/ScoreSystem.cpp

Gui.o : src/Gui.cpp
        $(CCXX) $(CXXFLAGS) src/Gui.cpp

clean :
        rm snake *.o
 

Anyone knows what the problem is ? When I was linking SFML dynamically my window was showing as expected.

Thank you !
Title: Re: SFML static : window won't open
Post by: eXpl0it3r on July 04, 2017, 03:09:19 pm
Is the created window larger than your screen?
Title: Re: SFML static : window won't open
Post by: AnselmeSfml on July 04, 2017, 03:15:43 pm
No, the window is 500x500, something like that, so it is smaller than my screen. :/
Thank you
Title: Re: SFML static : window won't open
Post by: eXpl0it3r on July 04, 2017, 03:37:35 pm
If you build the SFML examples, do they work (the ones that create a window)?
Title: Re: SFML static : window won't open
Post by: AnselmeSfml on July 04, 2017, 03:56:15 pm
No, even with the tutorials examples the window won't open.