Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Multiple Include Files Using Eclipse and MinGW(Include directories after the first one are ignored)
Multiple Include Files Using Eclipse and MinGW [message #1506074] Wed, 10 December 2014 15:01
Rex Goode is currently offline Rex GoodeFriend
Messages: 1
Registered: December 2014
Junior Member
I am using Eclipse Luna in a Windows environment to write programs in C++. I compile with MinGW. I am also using OpenCV and libxml2.

I have need of having to Include directories, which I set up under Tool Settings in the project properties. One directory points at OpenCV and the other at libxml2.

In my source code, I have .h and .hpp files for both that I #include. I spent hours checking and rechecking that I've specified them correctly, i.e.

#include <libxml/xmlreader.h>
#include <opencv2/highgui/highgui.hpp>


It sometimes says that it can't find the libxml include files and sometimes it can't find the OpenCV files, giving errors like this: fatal error: opencv2/imgproc/imgproc.hpp: No such file or directory.

I finally looked at the console output and discovered that the compiler command was:

g++ "-IC:\\MinGW\\include\\libxml2" -O3 -Wall -c -fmessage-length=0 -o "Source\\Box.o" "..\\Source\\Box.cpp" 


It doesn't include the include directory for OpenCV. If I reverse the order in the Tool Settings dialog, in other words, move the OpenCV directory to the top of the list, then it can't find the libxml include files.

Sometimes it compiles fine without errors, but when I go to run it in the debugger, it tells me there are errors then.

How do I get the command line for the compiler to be more like the following?

g++ "-IC:\\MinGW\\include\\ibxml2 C:\\opencv\\build\\include" -O3 -Wall -c -fmessage-length=0 -o "Source\\Box.o" "..\\Source\\Box.cpp"


If I navigate to project | Properities | Tool Settings | GCC C++ Compiler, the dialog there shows the command as "g++" and the "All Options" field says:

-I"C:\opencv\build\include" -I"C:\MinGW\include\libxml2" -O0 -g3 -Wall -c -fmessage-length=0 -v
Previous Topic:Visual frame swing
Next Topic:C Socket Programming
Goto Forum:
  


Current Time: Thu Mar 28 22:02:34 GMT 2024

Powered by FUDForum. Page generated in 0.03826 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top