1

I am trying to migrate a custom C++ project which uses Gtkmm3.0 to Eclipse (Oxygen) on Ubuntu 16.04. The project has its own Makefile and builds fine from the terminal within Eclipse. What I have not been able to do so far is tell the indexer about Gtkmm, and I get lots of these (which is very annoying):

enter image description here

When I hover over the little red bugs, it says:

Type 'Cairo::RefPtr<Cairo::Context>' could not be resolved.

I have done a lot of Googling on this and found nothing so far because all answers seem to assume the project's build tools are managed by Eclipse (See this or this, for example). In my case I have a makefile project instead of an executable project and hence some options are not available to me. For example, the first links speaks about configuring the builder:

We have to add all this directories. On Eclipse select the Project->Properties menu option. Select C/C++ Build->Settings property page and GNU C++ Compiler->Directories from the Tool Settings tab. Now we have to add all directories. In my case (Makefile project) only two tabs are available there: Binary Parsers and Error Parsers.

How can I tell the Eclipse indexer I am using Gtkmm3.0?

BobMorane
  • 3,870
  • 3
  • 20
  • 42

1 Answers1

0

Found the solution that works for me:

  1. Open a terminal and enter:

    pkg-config --cflags gtkmm-3.0

You will see a list of includes directories (starting with -I). These are the directories you want to add in Eclipse so that it can locate the Gtkmm symbols in the editor.

  1. In Eclipse, go to:

    Project -> Properties -> C++ General -> Paths and Symbols

In the Includes tab, select GNU C++. You need to add here add the include directories found in step 1. There is no automated way to do this, yo must enter them one by one.

One trick that can save you some time is to edit manually the Eclipse project setting XML file and add the include directories directly in the XML file. By the end, you should have something that looks like this:

GUI final

That did it for me, hope this helps!

Community
  • 1
  • 1
BobMorane
  • 3,870
  • 3
  • 20
  • 42