specifying header filepaths for MANY different paths

Hi guys. I'm trying to get a library I've downloaded to work with a project in Dev-C++.

The problem is that the header files are scattered all over the place in various different directories, and the only way I know of telling Dev-C++ where to find them is by telling it which specific folder to look in (Tools > Compiler Options > Directories > C++ Includes).

All the headers' includes only go up to a certain level (for example, #include "opencv2/core/core_c.h"). They don't trace all the way back to the root folder. There's no way I'm going to go through every single header file and spell out the entire filepath of each header file.

I AM a newbie, so I'm sure I'm missing something here. Any tips? Does CMake have something to do with it? Because I don't think CMake works with Dev-C++.

Thanks!
Michael
Last edited on
Create a folder where you put headers (in the same directory structure as they come) and copy them there.

For example, the boost headers have a specific directory structure.

On Windows, for example, you can create a directory in your user directory:

    C:\Users\bonbonbaron\include\

Copy the boost directory into that folder, so you have:

    C:\Users\bonbonbaron\include\boost\

Tell your IDE to include the directory: "C:\Users\bonbonbaron\include".

Now you can #include stuff the usual way:

#include <boost/locale.hpp>

It works the same in Linux.

Hope this helps.
@OP: You should only have to include a handful of header paths in your project, like two or three at most. The rest of them reference each other based on their relative directories. It sounds like you're over thinking this.
closed account (jyU4izwU)
http://clicktobegin.net/programming/why-you-shouldnt-use-dev-c/
@Computergeek01: what "should" be is nice and all, but the reality is that OpenCV (the library I'm wanting to use) has lots and lots of "include" directories. Also, they do not reference each other by relative directories, unfortunately.

@Ibrahim: Thanks. I'll see what Code Blocks can do then.

@Duoas: I want to see if I can avoid this method. OpenCV has too many directories for me to drag and drop into a different folder.
Last edited on
@Duoas: I want to see if I can avoid this method. OpenCV has too many directories for me to drag and drop into a different folder.

Um, no it doesn't. You're doing something wrong.
> OpenCV has too many directories for me to drag and drop into a different folder.
$ move C:\whatever\directory\you\saved\opencv2 C:\Users\bonbobaron\include\opencv2



> All the headers' includes only go up to a certain level (for example,
> #include "opencv2/core/core_c.h"). They don't trace all the way back to the root folder
> Also, they do not reference each other by relative directories, unfortunately.
that is not a problem.
After you add C:\Users\bonbobaron\include to the include path, the references like #include "opencv2/core/core_c.h" would be resolved to C:\Users\bonbobaron\include\opencv2\core\core_c.h. That's the idea.
Topic archived. No new replies allowed.