You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Cool project :) I had to overcome a few problems to build this in macOS 11.3 20E232, but since I don't really know what I'm doing with C++, I'm not sure how incorrect my workarounds are. That said, I still want to share my notes for anyone else who may be interested:
Adding an int parameter to EventCallbackMap is something I've also had to do in various other projects from johnBuffer. I don't really know why it's needed, although the problem was loosely described as 'non-portable usage' by some SO post.
diff --git a/include/event_manager.hpp b/include/event_manager.hpp
index 99c1bc9..383e4ff 100644
--- a/include/event_manager.hpp+++ b/include/event_manager.hpp@@ -11,7 +11,7 @@ namespace sfev
using EventCallback = std::function<void(const sf::Event& event)>;
template<typename T>
-using EventCallbackMap = std::unordered_map<T, EventCallback>;+using EventCallbackMap = std::unordered_map<T, EventCallback, std::hash<int>>;
/*
@@ -142,4 +142,4 @@ private:
EventCallbackMap<sf::Event::EventType> m_events_callmap;
};
-} // End namespace
\ No newline at end of file
+} // End namespace
I also ended up grabbing transition.hpp from one johnBuffer's other projects (FastTyper) after noticing that it includes this file as well, and builds without error.
Finally, some coercion of CMake was needed. This is probably the most incorrect of these patches. I also set SFML_DIR in my shell environment prior to invoking cmake (in my case, export SFML_DIR=/opt/brew/Cellar/sfml/2.5.1)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e5cf9b6..4ed3acd 100644
--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -1,23 +1,26 @@
cmake_minimum_required(VERSION 3.5)
project(Foucloids VERSION 1.0.0 LANGUAGES CXX)
-set(SFML_DIR "" CACHE PATH "SFML lib path")-set(SFML_LIB_DIR "${SFML_DIR}/lib")-set(SFML_INC_DIR "${SFML_DIR}/include")+set(CMAKE_CXX_FLAGS "-std=c++11")++# Detect and add SFML+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})+find_package(SFML 2 REQUIRED COMPONENTS network audio graphics window system)
find_package(OpenGL)
-set(SFML_LIBS "${SFML_LIB_DIR}/sfml-graphics-s.lib"- "${SFML_LIB_DIR}/sfml-window-s.lib"- "${SFML_LIB_DIR}/sfml-system-s.lib"- "${SFML_LIB_DIR}/freetype.lib"+set(SFML_LIBS "${SFML_LIB_DIR}/libsfml-graphics.2.5.1.dylib"+ "${SFML_LIB_DIR}/libsfml-window.2.5.1.dylib"+ "${SFML_LIB_DIR}/libsfml-system.2.5.1.dylib"+ //"${SFML_LIB_DIR}/freetype.lib"
"${OPENGL_LIBRARIES}"
"winmm.lib"
)
+
set(SOURCES "src/main.cpp")
add_executable(foucloids ${SOURCES})
add_definitions(-DSFML_STATIC)
-target_include_directories(foucloids PRIVATE "${SFML_INC_DIR}" "include")-target_link_libraries(foucloids ${SFML_LIBS})
\ No newline at end of file
+target_include_directories(foucloids PRIVATE "${SFML_INC_DIR}" "include" "lib")+target_link_libraries(foucloids sfml-system sfml-window sfml-graphics)
\ No newline at end of file
To re-iterate, I don't think much of this (if any) should be taken as-is, but this "works for me" in macOS 11.3.
The text was updated successfully, but these errors were encountered:
Hi,
I needed a little bit of your help, I am using Ubuntu and I used the install.sh script to create executable files this is that same script the one in the AntSimulator repository but it is giving an error while compiling [ 50%] Building CXX object CMakeFiles/foucloids.dir/src/main.cpp.o /home/harshal/harshal/fun_github_repos/Foucloids/src/main.cpp:7:10: fatal error: dynamic_blur.hpp: No such file or directory 7 | #include <dynamic_blur.hpp> | ^~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/foucloids.dir/build.make:82: CMakeFiles/foucloids.dir/src/main.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/foucloids.dir/all] Error 2 make: *** [Makefile:103: all] Error 2
your help will be appreciated,
Thankx
Hi! Cool project :) I had to overcome a few problems to build this in macOS 11.3 20E232, but since I don't really know what I'm doing with C++, I'm not sure how incorrect my workarounds are. That said, I still want to share my notes for anyone else who may be interested:
Adding an int parameter to EventCallbackMap is something I've also had to do in various other projects from johnBuffer. I don't really know why it's needed, although the problem was loosely described as 'non-portable usage' by some SO post.
I also ended up grabbing
transition.hpp
from one johnBuffer's other projects (FastTyper) after noticing that it includes this file as well, and builds without error.... and corresponding changes to
main/src.cpp
:Finally, some coercion of CMake was needed. This is probably the most incorrect of these patches. I also set
SFML_DIR
in my shell environment prior to invoking cmake (in my case,export SFML_DIR=/opt/brew/Cellar/sfml/2.5.1
)To re-iterate, I don't think much of this (if any) should be taken as-is, but this "works for me" in macOS 11.3.
The text was updated successfully, but these errors were encountered: