amhndu / SimpleNES

An NES emulator in C++
GNU General Public License v3.0
4.85k stars 1.12k forks source link

CMake Error when configure it #16

Closed HaloSun closed 2 years ago

HaloSun commented 3 years ago

When configure it in cmake, it shows the Error: _CMake Error at cmake/Modules/FindSFML.cmake:358 (message): Could NOT find SFML (missing: SFML_AUDIO_LIBRARY SFML_GRAPHICS_LIBRARY SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY) Call Stack (most recent call first): CMakeLists.txt:63 (findpackage) It seems that FindSFML.cmake has been removed when use SFML 2.5.0 or higher version.

amhndu commented 3 years ago

Hey sorry, I just notice this. I've been away from C++ and the SFML ecosystem for a couple of years. If you can provide a PR or a link, I'd greatly appreciate.

MistEO commented 3 years ago

This error means that the SFML library is missing, just compile after installation.

For example, on Ubuntu

sudo apt update
sudo apt-get install libsfml-dev
sudo ldconfig -v
Pilot-91 commented 3 years ago

1> 已为默认配置“x64-Debug”启动 CMake 生成。 1> 命令行: "C:\Windows\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "D:\DEVELOPER_TOOLS\VISUAL STDIO\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:\github2\SimpleNES-master\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="D:/developer_tools/Visual Stdio/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="D:/developer_tools/Visual Stdio/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="D:\DEVELOPER_TOOLS\VISUAL STDIO\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\github2\SimpleNES-master" 2>&1" 1> 工作目录: D:\github2\SimpleNES-master\out\build\x64-Debug 1> [CMake] CMake Error at cmake/Modules/FindSFML.cmake:358 (message): 1> [CMake] Could NOT find SFML (missing: SFML_AUDIO_LIBRARY SFML_GRAPHICS_LIBRARY 1> [CMake] SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY) 1> [CMake] Call Stack (most recent call first): 1> [CMake] CMakeLists.txt:64 (find_package) 1> [CMake] -- Configuring incomplete, errors occurred! 1> [CMake] See also "D:/github2/SimpleNES-master/out/build/x64-Debug/CMakeFiles/CMakeOutput.log". 1> “C:\Windows\system32\cmd.exe”“/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "D:\DEVELOPER_TOOLS\VISUAL STDIO\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:\github2\SimpleNES-master\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="D:/developer_tools/Visual Stdio/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="D:/developer_tools/Visual Stdio/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="D:\DEVELOPER_TOOLS\VISUAL STDIO\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\github2\SimpleNES-master" 2>&1"”执行失败,出现错误:““C:\Windows\system32\cmd.exe”“/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "D:\DEVELOPER_TOOLS\VISUAL STDIO\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:\github2\SimpleNES-master\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="D:/developer_tools/Visual Stdio/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="D:/developer_tools/Visual Stdio/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="D:\DEVELOPER_TOOLS\VISUAL STDIO\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\github2\SimpleNES-master" 2>&1"”已返回,并带有退出代码: 1”。

Could you please tell me how to solve this problem in windows?I also can not find SFML.

MistEO commented 3 years ago

1> [CMake] CMake Error at cmake/Modules/FindSFML.cmake:358 (message): 1> [CMake] Could NOT find SFML (missing: SFML_AUDIO_LIBRARY SFML_GRAPHICS_LIBRARY

SFML这个库你没装,装一下就行了。linux的源里一般都有,Windows我也不太清楚要咋装,查下看看

lalalalini commented 2 years ago

so...do u finish it now?i have the same problem now(QAQ),i have no idea how to solve it

amhndu commented 2 years ago

See https://www.sfml-dev.org/tutorials/2.5/ for instructions on how to setup your compiler / IDE with SFML