我正在尝试在hadoop中运行c++字数计算程序。当我运行以下命令时:
g++ wordcount.cpp -o a -L/usr/local/hadoop/lib/native -lhadooppipes -lhadooputils -lpthread -I/usr/local/hadoop/include -Wall
我收到以下错误:
/tmp/ccfwwM9D.o: In function `WordCountMap::map(HadoopPipes::MapContext&)':
wordcount.cpp:(.text._ZN12WordCountMap3mapERN11HadoopPipes10MapContextE[_ZN12WordCountMap3mapERN11HadoopPipes10MapContextE]+0x4a): undefined reference to `HadoopUtils::splitString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)'
/tmp/ccfwwM9D.o: In function `WordCountReduce::reduce(HadoopPipes::ReduceContext&)':
wordcount.cpp:(.text._ZN15WordCountReduce6reduceERN11HadoopPipes13ReduceContextE[_ZN15WordCountReduce6reduceERN11HadoopPipes13ReduceContextE]+0x5d): undefined reference to `HadoopUtils::toInt(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
wordcount.cpp:(.text._ZN15WordCountReduce6reduceERN11HadoopPipes13ReduceContextE[_ZN15WordCountReduce6reduceERN11HadoopPipes13ReduceContextE]+0x81): undefined reference to `HadoopUtils::toString[abi:cxx11](int)'
/usr/local/hadoop/lib/native/libhadooppipes.a(HadoopPipes.cc.o): In function `HadoopPipes::BinaryProtocol::createDigest(std::string&, std::string&)':
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:426: undefined reference to `EVP_sha1'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:426: undefined reference to `HMAC_Init'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:427: undefined reference to `HMAC_Update'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:429: undefined reference to `HMAC_Final'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:430: undefined reference to `HMAC_CTX_cleanup'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:436: undefined reference to `BIO_f_base64'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:436: undefined reference to `BIO_new'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:437: undefined reference to `BIO_s_mem'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:437: undefined reference to `BIO_new'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:438: undefined reference to `BIO_push'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:439: undefined reference to `BIO_write'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:440: undefined reference to `BIO_ctrl'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:441: undefined reference to `BIO_ctrl'
/home/ambari-qa/hadoop/hadoop-tools/hadoop-pipes/src/main/native/pipes/impl/HadoopPipes.cc:446: undefined reference to `BIO_free_all'
collect2: error: ld returned 1 exit status
暂无答案!
目前还没有任何答案,快来回答吧!