0

I have a C project in which I would like to use some C++ files. I've modified the Makefile accordingly, but I get the

make\mingw32-make.exe[1]: *** No rule to make target 

error.

I noticed that the included headers from the cpp standard library are not found.

Headers Not Found . picture

[Edit] As a note, all the .c, .cpp, .h files are in the same folder.

If I add

#include <string>

in the .c file it is found. In the .cpp it's not.

In Eclipse I've seen that I can't set includes for C++.

No C++ Includes . picture

Is there a way to do this ?

Thank you.

ossx
  • 147
  • 8
  • 2
    Why are you not making an C++ project? If this is no option you have to include the path where the C++ headers are as include path to the project. – Jonas Juffinger Aug 12 '16 at 07:02
  • I can't make a C++ project as the main project is based on a C template and the C++ files are the source and header files from an external library (alglib) – ossx Aug 12 '16 at 07:34
  • You probably *will* have to use a C++ `main()` function to get the C++ runtime set up properly. See [Using C++ library in C code](http://stackoverflow.com/questions/199418/using-c-library-in-c-code) – Bo Persson Aug 12 '16 at 08:05
  • As a first step I would like to see the includes resolved. The next one would be to actually use the C++ code in C code. (btw @BoPersson - Thank you for the link) – ossx Aug 12 '16 at 09:22

1 Answers1

0

Unfortunately I didn't find any solution for this issue. Still I am on the right path as there is a way to use the C code from Alglib.

http://forum.alglib.net/viewtopic.php?f=2&t=3766

It may be better to download CPython version of ALGLIB and to work with source of its computational core. It is written in C, without even trace amounts of C++, so you may find it more convenient than making wrappers around C++ core.

ossx
  • 147
  • 8