Folder ( directory) hierarchy is like this:
FolderRoot/FolderX/FolderY/main.c
FolderRoot/FolderZ/header.h
How to include (write) header.h into main.c
#include "../../??????header.h" ??
This is a discussion on header path & include within the C++ Programming forums, part of the General Programming Boards category; Folder ( directory) hierarchy is like this: FolderRoot/FolderX/FolderY/main.c FolderRoot/FolderZ/header.h How to include (write) header.h into main.c #include "../../??????header.h" ??...
Folder ( directory) hierarchy is like this:
FolderRoot/FolderX/FolderY/main.c
FolderRoot/FolderZ/header.h
How to include (write) header.h into main.c
#include "../../??????header.h" ??
#include "../../FolderZ/header.h"
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
If you are using GCC then you could just include the path to the headers like normal:
in main.c:
#include "header.h"
Then when compiling:
gcc main.c -I/FolderRoot/FolderZ/ -o myApp
Or this can be set in the Makefile if you are using that. Typically hardcoding even relative paths into include statements is bad juju.
thx, guys