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

Author Topic: Compiling SFML Sample in MSYS2/MinGW64 Environment  (Read 1968 times)

0 Members and 1 Guest are viewing this topic.

flow

  • Newbie
  • *
  • Posts: 2
    • View Profile
Compiling SFML Sample in MSYS2/MinGW64 Environment
« on: April 28, 2019, 10:29:52 pm »
Hi there,

First of all sorry if there has been a post on this subject before, but I recently picked up SFML and have been trying to set up for dev but have been running into an issue. I'm using the sample code from the tutorial (green circle window), but when I try to compile it from the command line (MSYS2 shell), with
Quote
g++ main.cpp -I/c/Lib/SFML-2.5.1/include -L/c/Lib/SFML-2.5.1/lib -lsfml-graphics -lsfml-window -lsfml-system
I run into this error
Quote
/c/Lib/SFML-2.5.1/include/SFML/Config.hpp:97:10: error: #error This UNIX operating system is not supported by SFML library
I'm currently using the binaries provided by the website for GCC 7.3.0 MinGW (SEH) - 64-bit, but am I misunderstanding which ones I'm supposed to use? BC the check for windows just checks if _WIN32 is defined but afaik mingw does not have this, but rather defines__MINGW32__

Any help would be appreciated, thanks

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: Compiling SFML Sample in MSYS2/MinGW64 Environment
« Reply #1 on: April 29, 2019, 10:00:53 pm »
We don't support MSYS2 or Cygwin "subsystems" with our CMake build system, since they pretend to be Linux systems, while still requiring some special treatment, w.r.t. linking MinGW and not some common Linux libraries.

I think you can still reap the benefits of MSYS2 in some way, by not using the shell directly, but I'd have to check how. I've done so in the past to get auto tools on Windows, but maybe that was just MSYS and not MSYS2?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

flow

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Compiling SFML Sample in MSYS2/MinGW64 Environment
« Reply #2 on: April 29, 2019, 10:58:46 pm »
Alright thanks for the response! I'll probably just end up using vs build tools instead, didn't realize MSYS wasn't supported officially and don't want to spend too much time trying to get something running on it.