SFML 2.3.2 (GCC 4.9.2 MinGW (DW2) - 32-bit)
///////////////////////////////////////////////////////
///if with MSYS22
///////////////////////////////////////////////////////
Install MSYS2.
it’s installed in C:\msys64
on 64-bit systems
C:\> SET LIBRARY_PATH=C:\msys64\mingw64\lib
C:\> SET PATH=%PATH%;C:\msys64\mingw64\bin
C:\> SET INCLUDE=C:\msys64\mingw64\include
pacman -S mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-sfml
main.cpp (test)
#include <SFML/Graphics.hpp>
int main() { sf::RenderWindow window(sf::VideoMode(640, 480), "SFML Application");
sf::CircleShape shape;
shape.setRadius(40.f);
shape.setPosition(100.f, 100.f);
shape.setFillColor(sf::Color::Cyan);
while (window.isOpen()) { sf::Event event;
while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close();
} window.clear();
window.draw(shape);
window.display();
}
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(untitled10)
set(CMAKE_CXX_STANDARD 11)
set(EXECUTABLE_NAME "untitled10")
add_executable(${EXECUTABLE_NAME} main.cpp)
find_package(SFML 2 COMPONENTS system window graphics network audio)
target_link_libraries(${EXECUTABLE_NAME}
libsfml-audio
libsfml-graphics
libsfml-network
libsfml-system
libsfml-window)
3 comments:
Приветствую, хотел уточнить, а где можно взять/посмотреть FindSFML.cmake файл?
Привет!
https://github.com/SFML/SFML-Game-Development-Book/blob/master/CMake/FindSFML.cmake ,
наверно это он, но я уже не уверен и я бы так уже не настраивал. Это скрипт для поиска sfml и ее зависимостей в системе, теперь я понимаю, что это не нужная магия. Лучше скачать и напрямую указать катологи или через msys2 (https://vasplace.blogspot.com/2019/07/msys2-sdl2-vscode.html).
Hi! (I'm sorry I don't speak russian) have you msys2 working with SFML? I'm trying to setup msys2+SFML but I can't do it yet.
I'll apreciate very much if you can help me.
Kind regards.
Mauricio.
Post a Comment