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

Author Topic: SFML CMake error  (Read 2674 times)

0 Members and 1 Guest are viewing this topic.

nogoodname

  • Newbie
  • *
  • Posts: 21
    • View Profile
SFML CMake error
« on: November 10, 2019, 06:18:19 pm »
I'm trying to build SFML with CMake using this tutorial.

Now I've managed to make the makefile with CMake.

However if I tried to build SFML using the "mingw32-make install" command I get this error.

Code: [Select]
[  1%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.
obj
'C:\PROGRA~1\MinGW\MINGW' is not recognized as an internal or external command,
operable program or batch file.
src\SFML\System\CMakeFiles\sfml-system.dir\build.make:62: recipe for target 'src
/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.obj' failed
mingw32-make[2]: *** [src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.obj]
Error 1
CMakeFiles\Makefile2:215: recipe for target 'src/SFML/System/CMakeFiles/sfml-sys
tem.dir/all' failed
mingw32-make[1]: *** [src/SFML/System/CMakeFiles/sfml-system.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

nogoodname

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: SFML CMake error
« Reply #1 on: November 10, 2019, 06:44:11 pm »
Well it seems like I've got this fix.

Apparently, MinGW doesn't like paths with spaces in them, so I had to move it away from Program Files and to somewhere else.

The build process works 100%.

However the installation has an error:

Code: [Select]
-- Install configuration: "Release"
-- Installing: C:/Program Files/SFML/./include
CMake Error at cmake_install.cmake:36 (file):
  file INSTALL cannot make directory "C:/Program Files/SFML/./include": No
  such file or directory.

  Makefile:72: recipe for target 'install' failed
  mingw32-make: *** [install] Error 1


Edit: Checked the tutorial and changing CMAKE_INSTALL_PREFIX fixes this.
« Last Edit: November 10, 2019, 06:50:46 pm by nogoodname »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: SFML CMake error
« Reply #2 on: November 10, 2019, 07:34:28 pm »
The second error is because CMake doesn't have the permission to create said directory. As you found out, it's better to set your own directory with CMAKE_INSTALL_PREFIX.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

nogoodname

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: SFML CMake error
« Reply #3 on: November 11, 2019, 02:01:57 pm »
Just realised that.

Using command prompt admin rather than the regular command prompt allows me to install SFML into Program Files.

Not sure why there isn't a way to directly open command prompt admin from the folder, so I don't have to copy the path.

 

anything