C
crea
I have a FANN library (ANN: http://leenissen.dk/fann/wp/ ) which I try to
compile. Its basically C-library but has C++ wrapper as well. So most files
are *.c.
C-compiling works ok, but when I compile C++ version then I get error:
"C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\math.h(514) : error
C2894: templates cannot be declared to have 'C' linkage"
So math.h function seems to give troubles. I can see it has to do with
mixing C and C++ things together...
Any advice? Somebody said that try to use C version of math.h library. How
to do that? (now its #include <math.h>). Or do I need to change all
c-files to cpp? Or other way to change everything to c++ style?
There is this kind of section in one file, which seems to be linked to this
problem. This is the only place where #ifdef __cplusplus and extern "C" is
used:
....
#ifdef __cplusplus
extern "C"
{
#ifndef __cplusplus
} /* to fool automatic indention engines */
#endif
#endif /* __cplusplus */
#ifndef NULL
#define NULL 0
#endif /* NULL */
....
compile. Its basically C-library but has C++ wrapper as well. So most files
are *.c.
C-compiling works ok, but when I compile C++ version then I get error:
"C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\math.h(514) : error
C2894: templates cannot be declared to have 'C' linkage"
So math.h function seems to give troubles. I can see it has to do with
mixing C and C++ things together...
Any advice? Somebody said that try to use C version of math.h library. How
to do that? (now its #include <math.h>). Or do I need to change all
c-files to cpp? Or other way to change everything to c++ style?
There is this kind of section in one file, which seems to be linked to this
problem. This is the only place where #ifdef __cplusplus and extern "C" is
used:
....
#ifdef __cplusplus
extern "C"
{
#ifndef __cplusplus
} /* to fool automatic indention engines */
#endif
#endif /* __cplusplus */
#ifndef NULL
#define NULL 0
#endif /* NULL */
....