Eclipse CDT 4.24.0 Meson project indexing headers - c++

I'm coding an application using gtkmm with Eclipse CDT and I created a Meson project, everything compile but I'm unable to make the indexer look for the gtkmm headers or any other headers that aren't part of the standard library.
Here is my meson.build file
project('gread', 'cpp')
subdir('src')
include_dir = include_directories('/usr/include/gtkmm-4.0/gtkmm')
gtkdep = dependency('gtkmm-4.0')
executable('gread', 'main.cpp', dependencies : gtkdep, include_directories : include_dir)
By any chance do someone know how to correct that ?
[UPDATE]
Problem partially solved,
I've added gtkmm-4.0 to the includes path like this :
it seems logic, because the include folder is the root for all include files, so 1 mystery solved.
But some class members are still unresolved. Any idea why ?

Related

boost program options config.hpp not found, Mac Xcode 8.3

Trying to compile simple example program with boost::program_options. The suggested include directive for the lib is
#include <boost/program_options.hpp>
I noticed the hard path to boost/program_options.hpp (relative to root folder) is:
boost/libs/program_options/include/boost/program_options.hpp.
And the symlinked path from the root folder boost/program_options/ points to hard path:
boost/libs/program_options/include/boost/program_options/
which is one level below the program_options.hpp file.
I assume I should set my header search path in Xcode to
boost/libs/program_options/include/
and not at boost root?
If I do the former, I get no errors in editor, and auto-completion works, but when I go to compile I get error:
fatal error: 'boost/config.hpp' file not found
#include <boost/config.hpp>
Any advice on how to include this? Have used 1/2-dozen other boost libs without problem.
UPDATE
Sorry, I missed that this lib was NOT header-only.
On building with the program_options lib, it's working fine.

KDevelop does not see C++ header files

I have a C++ project built of several shared libraries. Each library source code is placed under its subtree of directories. The main CMakeList file contains a list of add_subdirectory(<dirname>) directives. CMakeList files in every subdirectory contain definitions like the following:
set (SOURCE_FILES
util/src/Connector.cpp
pub/util/Connector.h
)
add_library(channels SHARED $( SOURCE_FILES))
SET_TARGET_PROPERTIES(channels PROPERTIES LINKER_LANGUAGE CXX)
where channels is the subdirectory name.
Although the search path for include files is set correctly and compilation works, KDevelop does not see the Connector.h header file and, therefore, its parsing and code/class browser do not work.
I know that .kdev_include_paths file in every directory might solve the problem. Unfortunately, this approach may not be used due to some additional constraints in our development environment.
Is there any other way to solve this issue?
I use Intel C/C++ compiler on RHEL 7.1 with KDevelop 5.0.4 running from AppImage.
I found and solved a problem which presented similarly - header files not seen and code/class browser failing. The cause turned out to be an error in my code. For the benefit of others who may write a similar bug and arrive at this page, here is what I did wrong:
I had a header only class in a file 'myClass.hpp' and an empty implementation 'myClass.cpp'. My CmakeLists.txt cited the implementation, but my implementation did not contain #include "myClass.hpp". The effect in Kdevelop-5.1.0 was that the header file was not parsed as part of the program - hence its includes were not read, and much of the code failed semantic analysis.
On KDevelop 5 this solved my issue:
Go to menu "Project" -> "Open Configuration..."
In the window which now opens, go to "Cppcheck" on it's left side and then to "Include Directories" on it's right side
check the "Use 'system' include dirs" option:
Try adding
include_directories(${SOURCE_FILES})
It appears I experienced the same problem.
Symptoms:
-- Kdevelop 5.1.2 could not find some #includes; they were underlined in source files.
-- There was no problem building the project
Cause:
-- Both symbolic links and the original *.h files were in the paths specified in
include_directories( ) in CMakeLists.txt. Symbolic link removal fixed the problem.
Kdevelop is probably right to be confused about multiple *.h files with the same name.
Maybe some future Kdevelop release will be able to recognize that it is dealing with only one target.

No such file (header file) error

I want to include a header file. I am working in a C++ environment, (C++11, Windows OS, Netbeans 7.3.1 IDE, Cygwin_4.x tool collection). I do not know how I setup the environment/IDE (I did it 6 months ago). I do not understand the fundamentals of the C++ build process or Cygwin related issues either, so I might have to fill in the gaps with some other references/documentation (on what specifically, I'm not sure).
My ultimate objective is to be able to include header files using a syntax that does not require the full file path. I want to write something terse, like:
#include "src\stuff\blah.h" //or even better: #include "blah.h"
The only way I can get my program to compile at all is by using the full file path, like this:
#include "C:\NetBeansProjects\Project1\src\stuff\blah.h"
And, I can only compile once using the full path. If I try to rebuild, it will bomb with the *** multiple target patterns. Stop. error. There are workarounds for this error; those being either 1) deleting the build and dist folders between each rebuild (yikes?), or 2) following this 16 step setup process.
I do not want to follow either of those workarounds because they do not appear to deliver what I want. How can I setup my environment to achieve what I want...of being able to include header files without using full paths?
Thanks to DanielKO for this answer.
In my case, I was able to include with the syntax:
#include "../stuff/blah.h"
I did not have to configure anything under the "Code Assistance" section for the C++ compiler.
All of my code is under "src" as the parent directory in my NetBeans project. It seems that the full path of the file is not required, and the only directory that must be referenced is the lowest level subdirectory (in my case, "stuff").
In NetBeans I've added the path to the list of libraries:
Go to Properties->Select C++->Select 'include libraries'->'Add'
Now: Add the path of the project folder with option "absolute"
Go to Properties->Select C++->Select 'Additional library directories'->'Add'
Now: Add the path of the project folder with option "absolute"
It's very obscure to me why the project doesn't recognize "own" header files.

error including Cplex library in cpp netbeans project

How can i add the cplex's library into my netbeans 7.4 cpp project?
I've tried to add inserting all the file path :
" #include "/Users/.../Applications/IBM/ILOG/CPLEX_Studio_Preview1251/cplex/include/ilcplex/ilocplex.h""
but I still have error, the compiler said:
There are unresolved includes inside
"/Users/.../Applications/IBM/ILOG/CPLEX_Studio_Preview1251/cplex/include/ilcplex/ilocplex.h""
Thank you
The correct way is to put in your .h/.cxx code
#include "ilcplex/ilocplex.h"
Then in your project setting you add an include path so you get a flag -I pointing to {somewhere}/cplex/include
This will solve the compilation problem.
But you should also set the library by adding the library cplex1251.lib (check name) and the library path {somewhere}/cplex/lib/vs{number}/{variant}
May be you should have a look at the manual
manual, IBM forum

Xcode - header files issue with .cpp file

I have imported my project from windows to mac and Is using xcode to compile the project.
I have managed to fix most error and bugs from the porting process but there is one bug/error I am unable to determine why its not working as it should. This probably due to my lack of knowledge of xcode but was wondering if anyone is able to help me with this problem.
The problem is this;
I have a two sub folders in my project, once called include and another called source. Of course include contains all the header files and source contains all the cpp files and such.
Example:
Root/
Include/
Header.h
Source/
test.cpp
Now in the build settings in the xcode project, I have added $(SRCROOT)/Include/ in the Header Serach Paths. So therefore I presume that xcode will include any header files in the Include folder.
So in the test.cpp class I add #include "Header.h". When I click build I get an error saying "'Header.h' file not found".
Im not entirely sure what I am doing wrong, of course I can do this for example - #include "../Include/Header.h" but that's going to be a pain going through all the cpp files in my project (which is a lot).
I was just wondering if anyone else came across this problem?
Thanks for reading.
In general you need to add the headers to the User Header Search Paths, which if you search the help in XCode will give you the format you need to pass the directory as.