-
Hi
I've already tried different other methods, but I can't find a working one. I need to compile a SFML program from Linux to Windows (it should only work on Windows). And no, I won't be using Windows for programming this application.
I am now using Mingw on Linux, but it ain't working. My command:
i586-mingw32msvc-g++ st2.cpp -o st2.exe -lsfml-system -lsfml-graphics -lsfml-window -I /home/niely/Projects/screen_terminator/SFML/
I've also tried to put the SFML folder by the Mingw executable. Also that ain't working.
How can I do this? And how can I compile it statically so I don't need the SFML folder on other computers?
Thanks for reading,
Niely
-
but it ain't working.[...]
Also that ain't working.
Great error description...
Have you read the documentation of your toolchain to know if and how it supports cross-compiling?
It might be much easier to use a VM and compile things directly in a Windows environment.
-
Compiling on Windows ain't working.
Error:
st2.cpp:6:27: error: SFML/Window.hpp: File doesn't exist.
st2.cpp:7:29: error: SFML/Graphics.hpp: File doesn't exist.
-
Your include path ain't correct.
-
I redownloaded Windows (32-bit version) and changed my path again, and this is the new error:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: cannot find -lsfml-system
collect2: ld returned 1 exit status
Command:
i586-mingw32msvc-g++ st2.cpp -o st2.exe -I /home/niely/Projects/screen_terminator/SFML-2.3/include/ -lsfml-system -lsfml-graphics -lsfml-window
-
Your library path ain't set :D
Maybe you should read the basic documentation of your compiler and linker before doing advanced things like cross-compiling...
-
I've already tried the -L and -I parameter, none working. What's the working command then?
-
-L
-
I've already tried that. -L without -I of course gives SFML/Window.hpp not found,
and this command:
i586-mingw32msvc-g++ st2.cpp -o output.exe -L/home/niely/Projects/screen_terminator/SFML-2.3/lib/ -lsfml-graphics -lsfml-window -lsfml-system -I/home/niely/Projects/screen_terminator/SFML-2.3/include/
Gives the collect2: returned with status 1 exit-error.
By the way, using the normal G++ (no mingw) this works perfectly:
g++ -o st st2.cpp -lsfml-system -lsfml-network -lsfml-graphics -lsfml-window