1

I am using ming, and it works for cross-compiling. When using SFML for ubuntu it works with no problem too. When I combine it:

i586-mingw32msvc-g++ -I/usr/include -std=c++11 main.cpp -o main.exe  -lsfml-system -lsfml-window -lsfml-audio -lsfml-graphics 

error I got is:

In file included from /usr/include/wchar.h:27:0,
             from /usr/lib/gcc/i686-w64-mingw32/4.9-win32/include/c++/cwchar:44,
             from /usr/lib/gcc/i686-w64-mingw32/4.9-win32/include/c++/bits/postypes.h:40,
             from /usr/lib/gcc/i686-w64-mingw32/4.9-win32/include/c++/iosfwd:40,
             from /usr/lib/gcc/i686-w64-mingw32/4.9-win32/include/c++/ios:38,
             from /usr/lib/gcc/i686-w64-mingw32/4.9-win32/include/c++/ostream:38,
             from /usr/include/SFML/System/Err.hpp:32,
             from /usr/include/SFML/System.hpp:34,
             from /usr/include/SFML/Window.hpp:32,
             from /usr/include/SFML/Graphics.hpp:32,
             from main.cpp:1:
/usr/include/features.h:398:23: fatal error: gnu/stubs.h: No such file or directory
#include <gnu/stubs.h>
                   ^
compilation terminated.
David G
  • 94,763
  • 41
  • 167
  • 253
  • You haven't provided the include path. You have to insert `-Ipath/to/SFML/include` – David G Dec 19 '14 at 22:08
  • AM sorry but i cant find SFML, I installed it using only sudo apt-get install libsfml-dev . Should i download and include path to that or... sorry for my little knowlage – Edin Dedić Dec 19 '14 at 22:30
  • Check inside usr/lib or lib. – David G Dec 19 '14 at 22:32
  • Couldnt find it there. – Edin Dedić Dec 19 '14 at 22:39
  • I found it it in usr/include/SFML , there i can see .hpp files i need. but i586-mingw32msvc-g++ -Iusr/include/SFML -std=c++11 main.cpp -o main.exe -lsfml-system -lsfml-window -lsfml-audio -lsfml-graphics still gives same error – Edin Dedić Dec 19 '14 at 22:46
  • `-I/usr/include` seems better. – Jarod42 Dec 19 '14 at 23:41
  • I found this http://stackoverflow.com/questions/7412548/error-gnu-stubs-32-h-no-such-file-or-directory-while-compiling-nachos-source installed: sudo apt-get install libc6-dev-i386 sudo apt-get install g++-multilib I get now huge amount of errors, one part of it looks like : /usr/lib/gcc/i686-w64-mingw32/4.9-win32/include/c++/cmath: At global scope: /usr/lib/gcc/i686-w64-mingw32/4.9-win32/include/c++/cmath:1038:11: error: ‘::double_t’ has not been declared using ::double_t; ^ /usr/lib/gcc/i686-w64-mingw32/4.9-win32/include/c++/cmath:1039:11: error: ‘::float_t’ has not been declare – Edin Dedić Dec 20 '14 at 00:17
  • @EdinDedić This is mere speculation, but I think that may be a sign that you're using the wrong installation. Are you running that code on Windows? Linux? If so, you need to use the correct version that's found on the SFML download site. – David G Dec 20 '14 at 00:23

0 Answers0