編譯Linux c++代碼的幾個(gè)問(wèn)題
1.c++項(xiàng)目移植到不同版本的linux平臺(tái),需要重新編譯一次。可能并不能順利地編譯通過(guò),
問(wèn)題可能出現(xiàn):gcc編譯器的版本,較高版的,對(duì)語(yǔ)法的檢查更加的嚴(yán)格,遇到的問(wèn)題是,
include文件的依賴(lài),template語(yǔ)法的聲明,所依賴(lài)的系統(tǒng)庫(kù)的缺失,在64位系統(tǒng)下編譯
32位程序等等。
2./usr/bin/ld: cannot find -lstdc++ 解決
sudo yum search "static" |grep "\(libc\|stdc\+\+\)"
將搜索到到包,安裝上就行了。
3.x86_64 Linux Error: gnu/stub-32.h
Fix for the RHEL/CentOS 5.x for GCC gnu/stub-32.h missing error
Type the following yum command:
# yum -y install glibc-devel.i386
Fix for the RHEL/CentOS 6.x for GCC gnu/stub-32.h missing error
Type the following yum command:
# yum -y install glibc-devel.i686 glibc-devel
請(qǐng)索引幫助文檔:
http://www.cyberciti.biz/faq/x86_64-linux-error-gnustub-32h-missing-error-and-solution/
4. uuid/uuid.h 找不到
yum -y install libuuid-devel