我添加了一个安全模块,需要安装cryptopp,用C语言编写,包含以下内容:
#include <Python.h>
#include <common/credentials.h>
#include "proto/security.pb.h"
#include <string.h>
我已经用Google搜索了错误并验证了Python.h标头是否存在,-I / usr / include / python2.6出现在make中,python-devel-2.6.6-52.el6 .x86_64软件包已安装。我错过了一面旗帜吗?它是&#34;命名空间&#34;还是解析错误?
g++ -o /home/build/workarea/1.0.0/build_fileclient/baseutils/src/cc/unixusergrouphelper.os -c -g -Wall -isystem/usr/local/protobuf-2.5.0//include -O2 -pthread -fPIC -fPIC -I/home/build/workarea/1.0.0/build_fileclient -I. -I/usr/include -I/usr/local/protobuf-2.5.0/include -I/home/build/workarea/1.0.0/build_fileclient/fs -Ifs -I/home/build/workarea/1.0.0/build_fileclient/fs/common/gperftools/src -Ifs/common/gperftools/src -I/home/build/workarea/1.0.0/build_fileclient/fs/server -Ifs/server -I/home/build/workarea/1.0.0/build_fileclient/fs/client -Ifs/client -I/usr/local/java/include -I/usr/local/java/include/linux -I/usr/include/python2.6 -I/home/build/workarea/1.0.0/build_fileclient/fs/client/fileclient/java/fs-jni/target/native/javah -Ifs/client/fileclient/java/fs-jni/target/native/javah -I/home/build/workarea/1.0.0/build_version -I/home/build/workarea/github/dl/hadoop-common/hadoop-hdfs-project/hadoop-hdfs -I/home/build/workarea/github/dl/hadoop-common/hadoop-hdfs-project/hadoop-hdfs/target/native baseutils/src/cc/unixusergrouphelper.cc
In file included from /usr/include/cryptopp/osrng.h:6:0,
from fs/common/credentials.h:6,
from baseutils/src/cc/securitymodule.c:2:
/usr/include/cryptopp/config.h:97:1: error: unknown type name 'namespace'
/usr/include/cryptopp/config.h:97:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
In file included from /usr/include/cryptopp/cryptlib.h:83:0,
from /usr/include/cryptopp/randpool.h:4,
from /usr/include/cryptopp/osrng.h:10,
from fs/common/credentials.h:6,
from baseutils/src/cc/securitymodule.c:2:
/usr/include/cryptopp/stdcpp.h:14:18: fatal error: memory: No such file or directory
compilation terminated.
In file included from /usr/include/cryptopp/osrng.h:6:0,
from fs/common/credentials.h:6,
from baseutils/src/cc/securitymodule.c:2:
/usr/include/cryptopp/config.h:97:1: error: unknown type name 'namespace'
/usr/include/cryptopp/config.h:97:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
In file included from /usr/include/cryptopp/cryptlib.h:83:0,
from /usr/include/cryptopp/randpool.h:4,
from /usr/include/cryptopp/osrng.h:10,
from fs/common/credentials.h:6,
from baseutils/src/cc/securitymodule.c:2:
/usr/include/cryptopp/stdcpp.h:14:18: fatal error: memory: No such file or directory
compilation terminated.
答案 0 :(得分:2)
GCC根据文件名的后缀决定文件的写入语言。将文件重命名为* .cc或* .cpp,或将-x c++
传递给g ++。