C++ linkage errors
I am porting a code which ran on HP unix to CentOS. It was a working code and compiled with gcc3.1.x and a c++ file and now I tried to compile with gcc3-3.4.6 and gcc4-4.2.4 also. But still I get this conflicts in declaration error as pasted below.
In file included from ../../../lol/ntk/nt_kslog.h:155,
from ../../../lol/ntk/nt_kernel.h:243,
from ../../../lol/ntk/nt_cp.h:110,
from ../../../soml/include/soml-afi-afu.h:131,
from ../../include/pcdb.h:58,
from ../../include/pcdb_addtypes.h:59,
from pcdb_addtypes.cc:94:
/opt/bcs/include/syslog.h:93: error: previous declaration of 'void syslog(int, const char*, ...)' with 'C++' linkage
/opt/bcs/include/syslog.h:93: error: conflicts with new declaration with 'C' linkage
I have the extern "C" included like this . But still I face the same problem . What Am I missing ??
#ifdef __cplusplus
extern "C" {
#endif
#include <syslog.h>
#include <stdarg.h>
#ifdef __cplusplus
}
#endif
Also , I work on Centos 5 box and it compiled without any issues on one machine and the same throws this error on other box with centos and both compilers.
Could anyone please help me , Where Am I going wrong ?
|