link: http://modest-destiny.net/wp/?p=77
I have been fighting with these strange errors for some days, and finally I got it.
The core problem is that my C_INCLUDE_PATH
and CPLUS_INCLUDE_PATH
ends with a colon. Path ending with a colon will include current path, aka./
which caused the error.
We need to remove the trailing colon, so I write a bash function for it.
# usage: removeTrailingColon str
# example:
# C_INCLUDE_PATH=$(removeTrailingColon $C_INCLUDE_PATH)
removeTrailingColon() {
if [[ $1 == *: ]]
then
local strColonRemoved=$1;
local strColonRemoved=${strColonRemoved:0:(-1)};
echo $strColonRemoved;
else
echo $1
fi
}
Usage is like this:
export C_INCLUDE_PATH=$(removeTrailingColon $C_INCLUDE_PATH)
export CPLUS_INCLUDE_PATH=$(removeTrailingColon $CPLUS_INCLUDE_PATH)
export LD_LIBRARY_PATH=$(removeTrailingColon $LD_LIBRARY_PATH)
export LIBRARY_PATH=$(removeTrailingColon $LIBRARY_PATH)
I’ll list the error I encountered building gcc-4.7.3, so that people will be able to access it through a search engine:
In file included from ../.././gcc/c-lang.c:24:
../.././gcc/system.h:499: error: conflicting types for ‘strsignal’
/usr/include/string.h:566: note: previous declaration of ‘strsignal’ was here
In file included from ./tm.h:19,
from ../.././gcc/c-lang.c:26:
./options.h:3750:2: error: #error too many masks for ix86_isa_flags
In file included from ../.././gcc/input.h:25,
from ../.././gcc/tree.h:27,
from ../.././gcc/c-lang.c:27:
../.././gcc/../libcpp/include/line-map.h:208: error: ‘CHAR_BIT’ undeclared here (not in a function)
../.././gcc/../libcpp/include/line-map.h:208: error: bit-field ‘reason’ width not an integer constant
../.././gcc/../libcpp/include/line-map.h:208: warning: ‘reason’ is narrower than values of its type
In file included from ../.././gcc/tree.h:32,
from ../.././gcc/c-lang.c:27:
../.././gcc/real.h:87:5: error: division by zero in #if
../.././gcc/real.h:87:5: error: division by zero in #if
../.././gcc/real.h:90:6: error: division by zero in #if
../.././gcc/real.h:90:6: error: division by zero in #if
../.././gcc/real.h:93:7: error: division by zero in #if
../.././gcc/real.h:93:7: error: division by zero in #if
../.././gcc/real.h:96:8: error: division by zero in #if
../.././gcc/real.h:96:8: error: division by zero in #if
../.././gcc/real.h:99:9: error: division by zero in #if
../.././gcc/real.h:99:9: error: division by zero in #if
../.././gcc/real.h:102:10: error: division by zero in #if
../.././gcc/real.h:102:10: error: division by zero in #if
../.././gcc/real.h:105:9: error: #error "REAL_WIDTH > 6 not supported"
In file included from ../.././gcc/c-family/c-common.h:26,
from ../.././gcc/c-tree.h:25,
from ../.././gcc/c-lang.c:28:
../.././gcc/../libcpp/include/cpplib.h:225: error: bit-field ‘type’ width not an integer constant
../.././gcc/../libcpp/include/cpplib.h:225: warning: ‘type’ is narrower than values of its type
In file included from ../.././gcc/c-family/c-common.h:26,
from ../.././gcc/c-tree.h:25,
from ../.././gcc/c-lang.c:28:
../.././gcc/../libcpp/include/cpplib.h:267:3: error: #error "Cannot find a least-32-bit signed integer type"
../.././gcc/../libcpp/include/cpplib.h:269: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cppchar_t’
../.././gcc/../libcpp/include/cpplib.h:270: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cppchar_signed_t’
../.././gcc/../libcpp/include/cpplib.h:768: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cpp_interpret_charconst’
../.././gcc/../libcpp/include/cpplib.h:779: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cpp_host_to_exec_charset’
../.././gcc/../libcpp/include/cpplib.h:954: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cpp_parse_escape’
make[2]: *** [c-lang.o] Error 1
Ubuntu 64-bit在安裝QuartusII的時候可能會出現:
libXext.so.6: cannot open shared object file
這樣的錯誤。
你可能locate libXext.so.6也能找到它,但其實QuartusII所要import的是32位的libXext.so.6。所以,簡單的辦法就是將32位的運行庫一起裝在機子上就可以了。
解決:
sudo apt-get install ia32-libs
很可能你的其他的安裝遇到“libXext.so.6和libXtst.so.6無法找到、無法打開”等問題也能使用這種方案解決。
看到他說的第一句話,非常感同身受啊。。。於是就轉載過來了。
感謝:http://jakwings.is-programmer.com/posts/35628.html
混蛋的,好不容易才知道,立刻发篇博文说一下……囧
## 只列出常规文件 find ./ -type f ## 只列出文件夹 find ./ -type d
find
的man page介绍太长了,眼花缭乱(用zsh的可无视= =;)!百度和GOOGLE的结果也太烂了,几乎全是ls方法。
既然用到find了,就不得不提它的另一个功能了:
## 对找到的所有文件进行批处理 find . -type f -exec chmod 644 {} \; # 后面的\;必须的,表示按行输出 find . -type d -exec chmod 755 {} \; # {} 表示找到的文件路径
好了,暂时介绍完毕,大家还是继续man find
去吧……