eclipse show errors but compiles when external makefile

Posted by Anthony on Stack Overflow See other posts from Stack Overflow or by Anthony
Published on 2013-11-13T09:50:52Z Indexed on 2013/11/13 9:52 UTC
Read the original article Hit count: 273

Filed under:
|
|
|
|

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/

© Stack Overflow or respective owner

Related posts about c++

Related posts about eclipse