Include statement: can't find SDL/SDL.h file - c++

My understanding is that when I build a C++ project in xcode and I have an include line in one of my C files in angle-bracket form then the C++ compiler that works with xcode looks in /System/Library/Frameworks/ to find the file. I think that because of this answer: when I use the line #include <OpenGL/gl.h> in my xcode project, where does it look for the gl.h file?
I have an SDL.h file at /System/Library/Frameworks/SDL.framework/headers/SDL.h (I downloaded the folder SDL.framework and copied it to that location with the command sudo cp -r /Volumes/SDL/SDL.framework System/Library/Frameworks)
But my include statement in one of the files in my xcode project still gives this error:
#include <SDL/SDL.h> //throws file not found
Did I properly install the SDL framework? Why doesn't xcode see it?

Under your projects Build Settings, do a search for "search". Add a header search path to the SDL directory /System/Library/Frameworks/SDL.framework/headers
Should be able to just do this after:
#include <SDL.h>
Hope that works for you.
You can also check out this link:
http://meandmark.com/blog/2012/01/using-sdl-with-xcode-4/
It's for Xcode 4, but it looks like all the pieces are there.

Related

gtk/gtk.h: No such file or directory, on Windows, using VS code

I try to compile a cpp file with this header:
#include <stdlib.h>
#include <gtk/gtk.h>
I work with MSYS2, so both the compiler and the gtk library are installed through it. The cpp compiler path is:
D:\msys\usr\bin\cpp.exe
and here is the VS code include path additions, which I supplied to the IntelliSense Configurations page under "include path":
D:\msys\mingw64\include\gtk-2.0\**
D:\msys\mingw64\include\**
D:\msys\mingw64\lib\**
D:\msys\usr\include\**
and I have gtk etc. in the include folder. I actually installed three different versions of gtk, 2-4.
Before I added them to the include path, I got an error like "cannot open source file", and after adding them I get the
fatal error: gtk/gtk.h: No such file or directory
error. gtk/gtk.h is located just inside gtk-2.0. What am I doing wrong?
Thanks a lot.

boost program options config.hpp not found, Mac Xcode 8.3

Trying to compile simple example program with boost::program_options. The suggested include directive for the lib is
#include <boost/program_options.hpp>
I noticed the hard path to boost/program_options.hpp (relative to root folder) is:
boost/libs/program_options/include/boost/program_options.hpp.
And the symlinked path from the root folder boost/program_options/ points to hard path:
boost/libs/program_options/include/boost/program_options/
which is one level below the program_options.hpp file.
I assume I should set my header search path in Xcode to
boost/libs/program_options/include/
and not at boost root?
If I do the former, I get no errors in editor, and auto-completion works, but when I go to compile I get error:
fatal error: 'boost/config.hpp' file not found
#include <boost/config.hpp>
Any advice on how to include this? Have used 1/2-dozen other boost libs without problem.
UPDATE
Sorry, I missed that this lib was NOT header-only.
On building with the program_options lib, it's working fine.

Freetype invalid preprocessor directive Eclipse

I've downloaded the latest version of FreeType and want to get the source code running in my program. I'm programming in Eclipse and I've copied all the Freetype files into my project. I've listed them under ProjectName/Source/FreeType2/..
I've added compiler include directories for the new folders, so my GCC C++ compiler knows where to look for them. However, if I build my project, an error occurs on the last line of the following code:
#include <ft2build.h>
#include FT_WINFONTS_H
#include FT_INTERNAL_DEBUG_H
I did some research and the macro file FT_INTERNAL_DEBUG_H is defined as <internal/ftdebug.h>. The file is present in my system and the macro file FT_WINFONTS_H compiles like a charm! I think it's got something to do with my directory stucture somehow. How should I change my directory structure in order to get things compiled succesfully? My current structure is like this:
ProjectName
Source
FreeType2
devel
docs
include
config
internal
objs
src
I know I used two "source" folders, but this shouldn't be the problem, right?
The error message I get is Invalid preprocessor directive: #include FT_INTERNAL_DEBUG_H
Thank you for your time ;)

Cannot include a header in MinGW

I'm using SublimeText with MinGW on Windows 7 an wanted to include
#include <boost/multiprecision/cpp_int.hpp>
but I get
fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
#include <boost/multiprecision/cpp_int.hpp>
Couldn't figure out what to do from what I've found here and in Google.
This is the path to the include folder:
C:\MinGW\include\
Should I add something like? (from what I could "understand")
-I C:/MinGW/include/boost
But it doesn't work...
you need to install boost (from boost.org). http://www.boost.org/users/history/version_1_57_0.html
your #include already starts with boost/ so it will look in include/boost.
UPDATE:
"-IC:/MinGW/include"
Oh okay, I figured it out.
So... I have all the necessary libraries here C:\MinGW\include\
But in order to be able to include boost files (C:\MinGW\include\boost) I needed to copy this folder here C:\MinGW\include\c++\4.9.1 which is where MinGW was looking for my files...
So in the end I get C:\MinGW\include\c++\4.9.1\boost with all the necessary libraries inside. Now it works.

Xcode Error - No such file or directory

I'm trying to build a project of mine that includes fuzzylite C++ libraries within a Carbon C++ application. However the compiler throws out an error for each fuzzylite's library I include in my source code. I've tried to include the Header Search Path and the Library Search Path on my target application build info but it doesn't work.
I've included the header file using double quote markers just like the following example:
#include "fuzzylite/test.h"
How can I include such library in my project and get it to work properly?
Easy, you need clean the path: #include "fuzzylite/test.h" for ALL #include, like this: #include "test.h"
From version 3.1, you should use #include fl/Headers.h.
If you are running into problems, I strongly encourage you to report the problem in the forums at http://www.fuzzylite.com, where I and others will be very happy to help you.