specifying header filepaths for MANY different paths

Jun 20, 2016 at 2:40am
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 Jun 20, 2016 at 2:43am
Jun 20, 2016 at 3:59am
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.
Jun 20, 2016 at 3:09pm
@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.
Jun 20, 2016 at 4:18pm
closed account (jyU4izwU)
http://clicktobegin.net/programming/why-you-shouldnt-use-dev-c/
Jun 20, 2016 at 8:24pm
@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 Jun 20, 2016 at 8:25pm
Jun 21, 2016 at 2:21am
@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.
Jun 21, 2016 at 4:03pm
> 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.