How to make eclipse recognize my included files in a Cisting Existing Makefile project?

A simple question: I have a C ++ project configured for an existing make file, and it compiles fine. However, the IDE continues to complain that it cannot resolve most of my characters.

How to configure eclipse to use my inclusions?

+6
source share
3 answers

Project-> properties-> C / C ++ General-> Paths and Symbol

Add the path to the include directory.

You can see in the screenshot the configuration that I use for development with Qt in C ++.

Screenshot representing Eclipse configuration for Qt Headers

+9
source

I added my inclusions in paths and characters, but they are not added at qt compilation time. To compile, qt uses these functions and ignores the words I added:

 g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Idebug -I. -o debug/bp.o bp.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Idebug -I. -o debug/Navigation.o Navigation.cpp Navigation.cpp:16:22: error: XnOpenNI.h: No such file or directory Navigation.cpp:17:26: error: XnCppWrapper.h: No such file or directory Navigation.cpp:18:20: error: XnHash.h: No such file or directory Navigation.cpp:19:19: error: XnLog.h: No such file or directory Navigation.cpp:22:16: error: cv.h: No such file or directory Navigation.cpp:23:18: error: cv.hpp: No such file or directory 

I found the answer here: QT Eclipse Integration - Adding External Libs

This seems to be a conflict between the CDT and the Qt constructor, so even if you add options to the CDT, as shown in the screenshot above, the compiler will not find them!

You need to add them to the xxx.pro file as follows: http://doc.qt.digia.com/4.5/qmake-variable-reference.html#includepath

+3
source

I had the same issue when I imported an existing Makefile project with:

File -> Create -> Makefile Project with Existing Code

If you don’t want to configure anything and want eclipse to recognize all the paths from your existing (working) Makefile, it simply does the following:

  • right click on your project -> Clean Project
  • right click on your project -> Assembly project

Then the Eclipse Indexer recognizes all the paths on its own without additional configuration. You just need Eclipse to execute the imported Makefile and everything will be allowed (if your Makefile is working correctly outside of Eclipse).

Tested:

 Eclipse IDE for C/C++ Developers Version: Luna Service Release 2 (4.4.2) Build id: 20150219-0600 
0
source

Source: https://habr.com/ru/post/903627/


All Articles