1

I have some c++ code using CImg and Eigen libraries. At the c++ code I define a plugin like this

#define cimg_plugin1 "my_plugin.h"
#include "CImg.h"

The plugin contains many method definitions that are used at the c++ code.

I also have a makefile that when called from the command line (./make), allows me to compile everything, and generates an executable.

I want to import this code into a new Eclipse project, and I do it so:

  • New>Project>C++ project>makefile project>empty project
  • unmark "Use default location", and select the folder containing my code at the filesystem
  • Project>properties>C/C++ Build>unmark "Use default build command" and set it to use my makefile
  • Also in project properties>C/C++ General>Paths and Symbols>Add paths to folders containing Eigen and CImg
  • Rebuild index
  • Clean project
  • Restart eclipse

When I build the project, eclipse tells me I have more than 1000 errors in "my_plugin.h", but it is capable to generate the executable. Even though, I would like to get rid of this errors, because they are annoying. Also, if I want to open the declaration of CImg methods used at the plugin, I can't.

I know it has been asked before, but any of the solutions I found were satisfactory for me (most of them enumerated at the previous list). The sources I visited are the following, and I would be really happy if you find and tell me others I didn't see.

Eclipse shows errors but project compile fine eclipse C project shows errors (Symbol could not be resolved) but it compiles Eclipse CDT shows some errors, but the project is successfully built http://www.eclipse.org/forums/index.php/t/247954/

11
  • Why don't you chose "Project with existing code" option in eclipse? It picks up make files and other project settings all from the directory. It is difficult assess what the IDE didn't pick from the configs that is used when building with command line.
    – fkl
    Nov 13, 2013 at 9:56
  • Can you include an example of some of the errors eclipse is giving?
    – benjymous
    Nov 13, 2013 at 10:07
  • @benjymous most of the errors are "Field/function ... could not be resolved", regarding CImg/Eigen functions that could be clearly resolved, as the program works when I execute it.
    – Anthony
    Nov 13, 2013 at 10:18
  • Does this answer help? stackoverflow.com/questions/10803685/… edit: or this one: stackoverflow.com/questions/10041453/…
    – benjymous
    Nov 13, 2013 at 10:22
  • already seen it, but "search For Unresolved Includes" doesn't return any one for me
    – Anthony
    Nov 13, 2013 at 10:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.