For a school project I am trying to set up SFML on my computer that runs Windows 10. The assignment is developing a small engine, based on SFML, in a few weeks. I am very new to C++, and I am not used to the working pipeline and the ways of C++ development yet.

At the moment I am trying to set things up so that I can work on the project from home, but I have a lot of trouble understanding and setting things up, since it's very different to what I'm use to.

My CMakeLists.txt file looks like the following:

cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_BUILD_TYPE Release) 
find_package(SFML 2.1 COMPONENTS system window graphics REQUIRED)
include_directories(${SFML_INCLUDE_DIR} ${PROJECT_SOURCE_DIR})
set(SOURCE_FILES main.cpp   )
set(HEADER_FILES            )
add_executable(CppEngine ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(CppEngine ${SFML_LIBRARIES})

I get a very strange error message, as a result, whenever I try to compile and run. It is particularly strange, because I am running on Windows:

error: #error This UNIX operating system is not supported by SFML library #error This UNIX operating system is not supported by SFML library

How can I fix this error?


1 Answer 1


CLion only supports Cygwin or MingW for Windows development. Cygwin is a compatibility layer for UNIX-like operating systems; MingW is a port of the UNIX development tools for creating native Windows applications. Microsoft's native development tools are unsupported by CLion according to their documentation.

Most desktop-like things such as games (that require OS-native features like graphics, audio, input, etc.) aren't going to work with Cygwin because it can't access native Windows APIs. You can eventually rig Cygwin up to run desktop apps on Windows, but the process is painful, the results are sub-par, and game frameworks like SFML will almost never bother to actually support such a configuration.

From a little Googling, others who've run into the SFML error you've posted were trying to use Cygwin. To SFML it looks like a UNIX system because that's what Cygwin pretends to be, hence why it thinks your Windows 10 OS is an "unknown UNIX operating system." The developers should properly detect Cygwin and at least provide a more accurate and detailed error ("SFML does not support the Cygwin environment; please use MingW if you wish to use UNIX development tools.") but that's their problem. :)


You'll either need to

  1. Configure CLion to use MingW


  1. Switch to using the free and fully-featured Microsoft Visual Studio Community development tools instead of CLion so you can get first-class Windows development capabilities.

I recommend the second option very strongly. Unless your school's curriculum requires you to use CLion for some reason, in which case I recommend transferring to a better school. :)

  • \$\begingroup\$ Just to confirm as someone contributing to SFML: SFML indeed doesn't support Cygwin, because of its weird hybrid state, especially considering available headers/API. Going to add a more explicit message later. \$\endgroup\$
    – Mario
    Sep 21, 2016 at 5:29
  • \$\begingroup\$ Thanks for the answer, I slightly suspected it must have been something along those lines since the path that accompanies the error goes through cygwin. I will go for the answers in the order you say because I work on osx mostly and I prefer to have my workflow more streamlined (so that gives clion a higher priority). \$\endgroup\$
    – MTesseracT
    Sep 21, 2016 at 13:03
  • \$\begingroup\$ @MTesseracT: you might consider VS Code then which has a C++ mode that supports both Microsoft's tools on Windows and clang++/lldb on OSX. About as close to the best of both worlds as you're going to get. \$\endgroup\$ Sep 22, 2016 at 4:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .