用PC机自带的g++编译,结果成功。
问题在哪?怎么解决?
具体海思编译时的编译信息为:
[root@ken build]# make DEBUG=0 GPIB=0 VERBOSE=1
/usr/bin/cmake -H/root/hisi/communicate/srcs -B/root/hisi/communicate/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /root/hisi/communicate/build/CMakeFiles /root/hisi/communicate/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/root/hisi/communicate/build'
make -f libctb-0.16/CMakeFiles/ctb-0.16.dir/build.make libctb-0.16/CMakeFiles/ctb-0.16.dir/depend
make[2]: Entering directory `/root/hisi/communicate/build'
cd /root/hisi/communicate/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/hisi/communicate/srcs /root/hisi/communicate/srcs/libctb-0.16 /root/hisi/communicate/build /root/hisi/communicate/build/libctb-0.16 /root/hisi/communicate/build/libctb-0.16/CMakeFiles/ctb-0.16.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/root/hisi/communicate/build'
make -f libctb-0.16/CMakeFiles/ctb-0.16.dir/build.make libctb-0.16/CMakeFiles/ctb-0.16.dir/build
make[2]: Entering directory `/root/hisi/communicate/build'
make[2]: Nothing to be done for `libctb-0.16/CMakeFiles/ctb-0.16.dir/build'.
make[2]: Leaving directory `/root/hisi/communicate/build'
/usr/bin/cmake -E cmake_progress_report /root/hisi/communicate/build/CMakeFiles 9 10 11 12 13 14 15 16
[ 50%] Built target ctb-0.16
make -f CMakeFiles/communicate.dir/build.make CMakeFiles/communicate.dir/depend
make[2]: Entering directory `/root/hisi/communicate/build'
cd /root/hisi/communicate/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/hisi/communicate/srcs /root/hisi/communicate/srcs /root/hisi/communicate/build /root/hisi/communicate/build /root/hisi/communicate/build/CMakeFiles/communicate.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/root/hisi/communicate/build'
make -f CMakeFiles/communicate.dir/build.make CMakeFiles/communicate.dir/build
make[2]: Entering directory `/root/hisi/communicate/build'
Linking CXX executable communicate
/usr/bin/cmake -E cmake_link_script CMakeFiles/communicate.dir/link.txt --verbose=1
/opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/bin/arm-hisiv200-linux-g++ -std=c++0x CMakeFiles/communicate.dir/user/ProtocolParse.cpp.o CMakeFiles/communicate.dir/user/CommunicationAPI.cpp.o CMakeFiles/communicate.dir/user/Protocol1.cpp.o CMakeFiles/communicate.dir/user/Command.cpp.o CMakeFiles/communicate.dir/user/ProtocolFactory.cpp.o CMakeFiles/communicate.dir/user/main.cpp.o CMakeFiles/communicate.dir/user/Crc16.cpp.o CMakeFiles/communicate.dir/user/IProtocol.cpp.o -o communicate -rdynamic lib/libctb-0.16.a -lpthread
CMakeFiles/communicate.dir/user/CommunicationAPI.cpp.o: In function `CAPI::setLog(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
CommunicationAPI.cpp:(.text+0x1e40): undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
CMakeFiles/communicate.dir/user/CommunicationAPI.cpp.o: In function `CAPI::updateMCU(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)':
CommunicationAPI.cpp:(.text+0x2fcc): undefined reference to `std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
collect2: ld returned 1 exit status
make[2]: *** [communicate] 错误 1
make[2]: Leaving directory `/root/hisi/communicate/build'
make[1]: *** [CMakeFiles/communicate.dir/all] 错误 2
make[1]: Leaving directory `/root/hisi/communicate/build'
make: *** [all] 错误 2
PC机编译信息为:
[root@ken build]# make DEBUG=0 GPIB=0
Scanning dependencies of target ctb-0.16
[ 6%] Building CXX object libctb-0.16/CMakeFiles/ctb-0.16.dir/src/fifo.cpp.o
[ 12%] Building CXX object libctb-0.16/CMakeFiles/ctb-0.16.dir/src/getopt.cpp.o
[ 18%] Building CXX object libctb-0.16/CMakeFiles/ctb-0.16.dir/src/iobase.cpp.o
[ 25%] Building CXX object libctb-0.16/CMakeFiles/ctb-0.16.dir/src/kbhit.cpp.o
[ 31%] Building CXX object libctb-0.16/CMakeFiles/ctb-0.16.dir/src/portscan.cpp.o
[ 37%] Building CXX object libctb-0.16/CMakeFiles/ctb-0.16.dir/src/serportx.cpp.o
[ 43%] Building CXX object libctb-0.16/CMakeFiles/ctb-0.16.dir/src/linux/timer.cpp.o
[ 50%] Building CXX object libctb-0.16/CMakeFiles/ctb-0.16.dir/src/linux/serport.cpp.o
Linking CXX static library ../lib/libctb-0.16.a
[ 50%] Built target ctb-0.16
Scanning dependencies of target communicate
[ 56%] Building CXX object CMakeFiles/communicate.dir/user/ProtocolParse.cpp.o
[ 62%] Building CXX object CMakeFiles/communicate.dir/user/CommunicationAPI.cpp.o
[ 68%] Building CXX object CMakeFiles/communicate.dir/user/Protocol1.cpp.o
[ 75%] Building CXX object CMakeFiles/communicate.dir/user/Command.cpp.o
[ 81%] Building CXX object CMakeFiles/communicate.dir/user/ProtocolFactory.cpp.o
[ 87%] Building CXX object CMakeFiles/communicate.dir/user/main.cpp.o
[ 93%] Building CXX object CMakeFiles/communicate.dir/user/Crc16.cpp.o
[100%] Building CXX object CMakeFiles/communicate.dir/user/IProtocol.cpp.o
Linking CXX executable communicate
[100%] Built target communicate
编译器版本信息分别为:
PC机的g++
[root@ken ~]# g++ -v
使用内建 specs。
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
海思的编译器版本信息为:
[root@ken ~]# arm-hisiv200-linux-g++ -v
Using built-in specs.
Target: arm-hisiv200-linux-gnueabi
Configured with: ../gcc-4.4-2010q1/configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --target=arm-hisiv200-linux-gnueabi --prefix=/home/c00132816/toolchain_glibc/install/arm-hisiv200-linux --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-arch=armv5te --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --disable-nls --enable-extra-hisi-multilibs --with-sysroot=/home/c00132816/toolchain_glibc/install/arm-hisiv200-linux/target --with-build-sysroot=/home/c00132816/toolchain_glibc/install/arm-hisiv200-linux/target --with-gmp=/home/c00132816/toolchain_glibc/install/host_lib --with-mpfr=/home/c00132816/toolchain_glibc/install/host_lib --with-ppl=/home/c00132816/toolchain_glibc/install/host_lib --with-cloog=/home/c00132816/toolchain_glibc/install/host_lib --with-libelf=/home/c00132816/toolchain_glibc/install/host_lib --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bstatic -lm' --enable-libgomp --enable-poison-system-directories --with-libelf=/home/c00132816/toolchain_glibc/install/host_lib --with-pkgversion='Hisilicon_v200(gcc4.4-290+glibc-2.11+eabi+nptl)' --with-bugurl=http://www.hisilicon.com/cn/service/claim.html
Thread model: posix
gcc version 4.4.1 (Hisilicon_v200(gcc4.4-290+glibc-2.11+eabi+nptl))
4 个解决方案
#1
帖子别沉,顶起
#2
有无大神告知原因,我用grep确定是匹配到二进制文件的,而且也用了-L和-l。
[root@xxx ~]# grep basic_istream /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/*
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.a
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so.6
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so.6.0.12
[root@xxx ~]# grep basic_ostream /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/*
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.a
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so.6
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so.6.0.12
[root@xxx ~]#
#3
那就不用c++的fstrem之类的流,用c的fopen来实现
#4
我是来看帖的,帖子别沉
顺便问下。。联合大厦上班的?
顺便问下。。联合大厦上班的?
#1
帖子别沉,顶起
#2
有无大神告知原因,我用grep确定是匹配到二进制文件的,而且也用了-L和-l。
[root@xxx ~]# grep basic_istream /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/*
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.a
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so.6
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so.6.0.12
[root@xxx ~]# grep basic_ostream /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/*
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.a
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so.6
匹配到二进制文件 /opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/lib/libstdc++.so.6.0.12
[root@xxx ~]#
#3
那就不用c++的fstrem之类的流,用c的fopen来实现
#4
我是来看帖的,帖子别沉
顺便问下。。联合大厦上班的?
顺便问下。。联合大厦上班的?