简体   繁体   中英

How to Compile SFML C++ Source Code From Linux to Windows on a Linux Distro?

I've been searching online for solutions for 5 hours and still can't compile on my Linux Distro (openSuSE) to Windows using the SFML API.

I can compile non-SFML applications without any problems using the MinGW compiler on openSuSE by invoking this command:

i686-w64-mingw32-g++ Main.cpp

However, whenever I compile a SFML program like this one: http://www.sfml-dev.org/tutorials/1.6/start-cb.php

I get this error: fatal error: SFML\\System.hpp: No such file or directory

I tried: i686-w64-mingw32-g++ Main.cpp -L /home/user/Downloads/SFML1.6/lib -lsfml-system

But I still get the same error.

My IDE is Eclipse Juno and I have installed the toolchain support for cross platform development for CDT in the optional features. Again, trying with Eclipse, my programs compile without any problems not using the SFML API. But once I compile a program using SFML, I get the error. Yes, it working using the GNU G++ with SFML. What I've tried is downloading SFML for Windows from the download page and compile (which is what I've shown previously) but it still does not work.

The error is complaining about SFML\\System.hpp . Please note the backslash in that. Even though you are targeting the Windows platform, header files should still be using forward slash.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM