SFML not working correctly on mac ./SFML/Window.hpp:32:10: fatal error: 'SFML/System.hpp' file not found - sfml

I downloaded and Followed the tutorial on how to install it on mac but when i open Geany and try to include everything from SFML i get an error here's
the error and my include code

The code itself is fine, but you'll have to add SFML's include directory to the include directories looked through by the compiler (or more specific: the preprocessor). Unfortunately I don't know how to set this in xcode though.

Related

g++ not finding header files during compilation despite headers existing in include path

I'm trying to run the SFML example found at the bottom of the page here using VSCode and g++.
Before compilation, the SFML include file C:\GL\SFML-master\include is in the C++ Configurations include path. VSCode throws errors if I change this, so I don't believe it's the problem.
However, when I run/debug the file, g++ throws fatal error: SFML/Audio.hpp: No such file or directory
I've tried playing around with the file location and path but I'm not quite sure what is actually going wrong.
The only code in my program is the example above, and the only changes I've made is that to the include path, and of course I actually have SFML downloaded. I'm using g++ 12.1.0 and SFML 2.5.1 if that makes any difference.

SFML headers not found when compiling using CMake and GCC (MacOS Sierra)

I have been trying to use SFML in a CMake project, specifically the header SFML/Audio.hpp. I installed SMFL using Homebrew, and both the .dylib-files and the headers should be located correctly, in /usr/local/lib and /usr/local/include, respectively.
Now running CMake works fine, telling me that it has Found SFML 2.4.2 in /usr/local/include.
However, when compiling the project (using make), I get the following error:
/path/to/project.hpp:12:10: fatal error: 'SFML/Audio.hpp' file not found.
Does anyone know why this is happening?
Note: Compiling works fine for colleagues of mine using the same CMake- and source files on various Linux operating systems.
This sounds like you simply forgot to add SFML's include directory. On Linux, they probably install SFML to some system path where GCC (or Clang) look by default, so they don't need any additional CMake directives.
Luckily, fixing this is pretty simple.
Add the following line to your CMakeLists.txt somewhere before defining targets:
include_directories(${SFML_INCLUDE_DIR})
The variable SFML_INCLUDE_DIR is populated when you successfully call find_package(SFML...).
While you're at it, you might also want to ensure to link to the proper library files in the correct order:
target_link_libraries(myTargetName ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
Again, both variables are populated automatically.

glfw3 for code::blocks 16.01 in ubuntu

I am facing a really for me time-expensive problem. I am new to ubuntu and want to start learning more about opengl by using the glfw. Of course I cannot switch the OS so I will have to stay at ubuntu. I have come so far that I installed the glfw( by following this "tutorial": 2. step by filipwasil), so I have got an include directory in the usr/local dir, aswell as a lib directory. The include directory contains the glfw3.h and the lib directory the libglfw3.a file. If I try to add them to my project in code::blocks it seems like only the include part works, because I can see the functions provided by the glfw while typing, but once I want to compile and run the project, I get an error for each glfw function call: like "not defined reference to e.g. glfwInit". The lib directory also contains a cmake dir, which contains glfwconfig and glfwtarget files, but I really do not know what these files should do. I also noticed the question by Artur, which is quiet identical, but it does not help me because I want to know which files exactly I have to add in order to get a running window. So may question is: How is it possible to make the code::blocks IDE, actually the gcc compiler, know whats behind the glfw functions?
Every help will be appreciated. Sorry for my bad english. :)
Add GL, GLEW and glfw in the linker settings. Note the "glfw" in lowercase

Opencv windows 7 cmake mingw-32 make error

I wanted to ask about an error I got when compiling opencv for windows7, I am following this
http://www.laganiere.name/opencvCookbook/chap1s1_2.shtml
and I have gotten to the part where both configure and generate commands on cmake are successful, but
when using mingw32-make command in the directory where cmake builds opencv, I am getting the following error:
fatal error: QApplication: No such file or directory
this happens in the file windw_QT.h which is located on the sources folder in openc, my exact path is
C:\Users\lenovo\Desktop\OpenCV248\opencv\sources\modules\highgui\src\window_QT.h
to be honest I could handle the cmake errors when it didn't know where to find the QT libraries, but I have no idea why compiling the sources yields this error, isn't QApplication supposed to exist in the very same folder as highgui.h
Based on your comment, you seem to have used cmake 2.6 for dealing with Qt 5. If you take a look at the Qt 5 cmake manual, you can see that you would need at least 2.8.3, but 2.8.11 is recommended:
CMake is a 3rd party tool with its own documentation. The rest of this manual details the specifics of how to use Qt 5 with CMake. The minimum version required to use Qt5 is CMake 2.8.3, but 2.8.11 is recommended.
Once you update, this all should start working.

How to use OpenCV2.2 with Dev C++ 4.9.9.2?

I wish to use opencv on my project work. Therefore, I downladed OpenCV2.2 http://sourceforge.net/projects/opencvlibrary/ and installed it. Then I made following configuration in Dev C++ 4.9.9.2 since i am using Dev C++ compiler for my works;
OpenCV library is installed in the C:\ OpenCV2.2 directory
Open Dev C++ and Tools ->Compiler Options and then add a new compiler named OpenCV
Then, click Add these commands to the linker command line and include following linker: -lopencv_core220d -lopencv_highgui220d -lopencv_video220d -lopencv_ml220d -lopencv_legacy220d -lopencv_imgproc220d
Add C:\ OpenCV2.2\include\opencv and C:\ OpenCV2.2\include\opencv2 on to C includes and C++ Includes on directories.
Also add static libaries paths to C:\ OpenCV2.2\lib and bin directory path to the C:\ OpenCV2.2\bin
then, i tried to compilng C programs on the sample directory but I got lot of error messages
Then, I downloaded Cmake (Windows (Win32 Installer) cmake-2.8.4-win32-x86.exe- binary distributions) from “http://www.cmake.org/cmake/resources/software.html and instaled it. According to the OpenCV installation guide (http://opencv.willowgarage.com/wiki/InstallGuide), I tried to configure opencv using Cmake. I did this using Cmake GUI and also tried using command line however both attempts were not success anf got lot of error messages (ex.Error in configuration process , project files may be invalid).
Please give me correct steps to do this.