Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Linux Cross compiling to Windows  (Read 1403 times)

0 Members and 1 Guest are viewing this topic.

rags2riches

  • Newbie
  • *
  • Posts: 1
    • View Profile
Linux Cross compiling to Windows
« on: February 27, 2015, 05:02:00 am »
I am trying out the tutorials and can cross compile using the winGW standard  32 and 64 bit programs.
When I start trying to incorporate the sfml libraries I get all kinds of errors.
I am compiling command line so I can see the errors and quickly fix them.
This is what I have so far for 32 bit.

/opt/mingw32/bin/i686-w64-mingw32-g++ -Wall -g -O3 -c -o p1.exe p1.cpp -I/usr/include -lsfml-system -lsfml-window -lsfml-audio -lsfml-graphics -I /usr/include/SFML/  -L /opt/mingw32/lib/ -I /opt/mingw32/include/ -mwindows -DSFML_DYNAMIC

for 64 bit I simply change to /opt/mingw64/bin/i686-w64-nmingw64-g++


These are the errors

----- compile---
In file included from /opt/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.5.4/../../../../i686-w64-mingw32/include/c++/4.5.4/cwctype:46:0,
                 from /opt/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.5.4/../../../../i686-w64-mingw32/include/c++/4.5.4/bits/locale_facets.h:41,
                 from /opt/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.5.4/../../../../i686-w64-mingw32/include/c++/4.5.4/bits/basic_ios.h:39,
                 from /opt/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.5.4/../../../../i686-w64-mingw32/include/c++/4.5.4/ios:45,
                 from /opt/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.5.4/../../../../i686-w64-mingw32/include/c++/4.5.4/ostream:40,
                 from /usr/include/SFML/System/Err.hpp:32,
                 from /usr/include/SFML/System.hpp:34,
                 from /usr/include/SFML/Window.hpp:32,
                 from d1.cpp:1:
/usr/include/wctype.h:52:27: error: conflicting declaration 'typedef long unsigned int wctype_t'
/opt/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.5.4/../../../../i686-w64-mingw32/include/_mingw.h:407:24: error: 'wctype_t' has a previous declaration as 'typedef short unsigned int wctype_t'

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Linux Cross compiling to Windows
« Reply #1 on: February 27, 2015, 07:38:32 am »
This doesn't seem to be related to SFML, rather to your toolchain. Have you tried to compile a hello world program?
Laurent Gomila - SFML developer