hadoop在ubuntu 16.04和g ++ 5.4.0中链接C ++字数统计时传递未定义的引用

问题描述 投票:0回答:1

我正在尝试在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
c++ hadoop g++ ubuntu-16.04
1个回答
0
投票
您必须定位链接:-lcrypto
© www.soinside.com 2019 - 2024. All rights reserved.