hadoop问题:对‘xdrmem_create’、‘xdr_float’未定义的引用

[WARNING] /usr/bin/c++   -g -O2 -Wall -pthread -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE    -rdynamic CMakeFiles/wordcount-nopipe.dir/main/native/examples/impl/wordcount-nopipe.cc.o  -o examples/wordcount-nopipe libhadooppipes.a libhadooputils.a -lssl -lcrypto -ldl 
[WARNING] make[2]: 离开目录“/home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/target/native”
[WARNING] make[1]: 离开目录“/home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/target/native”
[WARNING] libhadooputils.a(SerialUtils.cc.o):在函数‘HadoopUtils::serializeFloat(float, HadoopUtils::OutStream&)’中:
[WARNING] /home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/src/main/native/utils/impl/SerialUtils.cc:250:对‘xdrmem_create’未定义的引用
[WARNING] /home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/src/main/native/utils/impl/SerialUtils.cc:250:对‘xdrmem_create’未定义的引用
[WARNING] /home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/src/main/native/utils/impl/SerialUtils.cc:251:对‘xdr_float’未定义的引用
[WARNING] /home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/src/main/native/utils/impl/SerialUtils.cc:251:对‘xdr_float’未定义的引用
[WARNING] libhadooputils.a(SerialUtils.cc.o):在函数‘HadoopUtils::deserializeFloat(float&, HadoopUtils::InStream&)’中:
[WARNING] /home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/src/main/native/utils/impl/SerialUtils.cc:267:对‘xdrmem_create’未定义的引用
[WARNING] /home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/src/main/native/utils/impl/SerialUtils.cc:267:对‘xdrmem_create’未定义的引用
[WARNING] /home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/src/main/native/utils/impl/SerialUtils.cc:268:对‘xdr_float’未定义的引用
[WARNING] /home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/src/main/native/utils/impl/SerialUtils.cc:268:对‘xdr_float’未定义的引用
[WARNING] collect2: 错误:ld 返回 1
[WARNING] make[2]: *** [CMakeFiles/pipes-sort.dir/build.make:88:examples/pipes-sort] 错误 1
[WARNING] make[1]: *** [CMakeFiles/Makefile2:107:CMakeFiles/pipes-sort.dir/all] 错误 2
[WARNING] make[1]: *** 正在等待未完成的任务....

问题分析:
xdrmem_create函数定义在rpc/xdr.h头文件。有时候可能还是内核版本问题,需要更换内核。
解决方法:
使用LDFLAGS增加库文件连接

export LDFLAGS=/usr/lib64/libtirpc.so

修改静态库连接地址路径
/home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/target/native/CMakeFiles/wordcount-nopipe.dir/link.txt
/home/hadoop/hadoop-3.2.1-src/hadoop-tools/hadoop-pipes/target/native/CMakeCache.txt
相关链接:
https://blog.csdn.net/beizhengren/article/details/77978949
https://www.jianshu.com/p/be38f37b4bd6
https://www.jianshu.com/p/a0c52f22cf31
http://www.studyems.com/network/e62afc909aaa136b.html
https://cp3.irmp.ucl.ac.be/projects/delphes/ticket/374
http://tieba.baidu.com/p/5640392865
https://blog.csdn.net/wbj0110/article/details/84606177
https://www.cnblogs.com/alexkn/p/4237515.html

你可能感兴趣的:(#,bug:,Hadoop)