Closed jcccn closed 10 years ago
你好,谢谢你的反馈。 我根据你贴的信息看了一下,主要的错误是在于ar 的时候 ar rc libcppjieba.a HMMSegment.o KeyWordExt.o MPSegment.o MixSegment.o SegmentBase.o Trie.o ar: temporary file: No such file or directory make[1]: \ [libcppjieba.a] Error 1 make: *\ [../cppjieba/libcppjieba.a] Error 2
搜到了这个答案(链接里面的最下面的楼主自己的回答) https://discussions.apple.com/thread/603889?start=0&tstart=0 是ar的时候: It was an environment variable! In my profile, for reasons which have been lost in antiquity, I set TMPDIR=/usr/tmp. 可能是你的TMPDIR设置的问题,指向了一个不存在目录,所以报错。
你根据这个再改一下试试?
wuyanyi09@gmail.com
发件人: Chuncheng Jiang 发送时间: 2013-10-09 10:04 收件人: aszxqw/cppjieba 主题: [cppjieba] OS X Mountain Lion下编译不过 (#2) g++ -c -Wall -O3 keywordext_demo.cpp In file included from keywordext_demo.cpp:3: In file included from ./../cppjieba/headers.h:8: In file included from ./../cppjieba/../cppcommon/headers.h:15: ./../cppjieba/../cppcommon/sort_functs.h:270:37: warning: '&&' within '||' [-Wlogical-op-parentheses] ...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
./../cppjieba/../cppcommon/sort_functs.h:270:37: note: place parentheses around
the '&&' expression to silence this warning
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
^
( )
./../cppjieba/../cppcommon/sort_functs.h:316:7: warning: 'stat64' is deprecated:
first deprecated in OS X 10.6 [-Wdeprecated-declarations]
if(stat64(pchFileIn, &stllFileSize)<0)
^
/usr/include/sys/stat.h:466:5: note: 'stat64' declared here
int stat64(const char , struct stat64 *) __OSX_AVAILABLE_BUT_DEPREC...
^
2 warnings generated.
cd ../cppjieba && make
g++ -c -g -Wall -DDEBUG HMMSegment.cpp
In file included from HMMSegment.cpp:1:
In file included from ./HMMSegment.h:7:
In file included from ./../cppcommon/headers.h:15:
./../cppcommon/sort_functs.h:270:37: warning: '&&' within '||'
[-Wlogical-op-parentheses]
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
./../cppcommon/sort_functs.h:270:37: note: place parentheses around the '&&'
expression to silence this warning
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
^
( )
./../cppcommon/sort_functs.h:316:7: warning: 'stat64' is deprecated: first
deprecated in OS X 10.6 [-Wdeprecated-declarations]
if(stat64(pchFileIn, &stllFileSize)<0)
^
/usr/include/sys/stat.h:466:5: note: 'stat64' declared here
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPREC...
^
2 warnings generated.
g++ -c -g -Wall -DDEBUG KeyWordExt.cpp
In file included from KeyWordExt.cpp:5:
In file included from ./KeyWordExt.h:8:
In file included from ./MPSegment.h:10:
In file included from ./Trie.h:15:
In file included from ./../cppcommon/headers.h:15:
./../cppcommon/sort_functs.h:270:37: warning: '&&' within '||'
[-Wlogical-op-parentheses]
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
./../cppcommon/sort_functs.h:270:37: note: place parentheses around the '&&'
expression to silence this warning
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
^
( )
./../cppcommon/sort_functs.h:316:7: warning: 'stat64' is deprecated: first
deprecated in OS X 10.6 [-Wdeprecated-declarations]
if(stat64(pchFileIn, &stllFileSize)<0)
^
/usr/include/sys/stat.h:466:5: note: 'stat64' declared here
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPREC...
^
2 warnings generated.
g++ -c -g -Wall -DDEBUG MPSegment.cpp
In file included from MPSegment.cpp:5:
In file included from ./MPSegment.h:10:
In file included from ./Trie.h:15:
In file included from ./../cppcommon/headers.h:15:
./../cppcommon/sort_functs.h:270:37: warning: '&&' within '||'
[-Wlogical-op-parentheses]
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
./../cppcommon/sort_functs.h:270:37: note: place parentheses around the '&&'
expression to silence this warning
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
^
( )
./../cppcommon/sort_functs.h:316:7: warning: 'stat64' is deprecated: first
deprecated in OS X 10.6 [-Wdeprecated-declarations]
if(stat64(pchFileIn, &stllFileSize)<0)
^
/usr/include/sys/stat.h:466:5: note: 'stat64' declared here
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPREC...
^
2 warnings generated.
g++ -c -g -Wall -DDEBUG MixSegment.cpp
In file included from MixSegment.cpp:1:
In file included from ./MixSegment.h:4:
In file included from ./MPSegment.h:10:
In file included from ./Trie.h:15:
In file included from ./../cppcommon/headers.h:15:
./../cppcommon/sort_functs.h:270:37: warning: '&&' within '||'
[-Wlogical-op-parentheses]
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
./../cppcommon/sort_functs.h:270:37: note: place parentheses around the '&&'
expression to silence this warning
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
^
( )
./../cppcommon/sort_functs.h:316:7: warning: 'stat64' is deprecated: first
deprecated in OS X 10.6 [-Wdeprecated-declarations]
if(stat64(pchFileIn, &stllFileSize)<0)
^
/usr/include/sys/stat.h:466:5: note: 'stat64' declared here
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPREC...
^
2 warnings generated.
g++ -c -g -Wall -DDEBUG SegmentBase.cpp
In file included from SegmentBase.cpp:1:
In file included from ./SegmentBase.h:7:
In file included from ./../cppcommon/headers.h:15:
./../cppcommon/sort_functs.h:270:37: warning: '&&' within '||'
[-Wlogical-op-parentheses]
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
./../cppcommon/sort_functs.h:270:37: note: place parentheses around the '&&'
expression to silence this warning
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
^
( )
./../cppcommon/sort_functs.h:316:7: warning: 'stat64' is deprecated: first
deprecated in OS X 10.6 [-Wdeprecated-declarations]
if(stat64(pchFileIn, &stllFileSize)<0)
^
/usr/include/sys/stat.h:466:5: note: 'stat64' declared here
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPREC...
^
2 warnings generated.
g++ -c -g -Wall -DDEBUG Trie.cpp
In file included from Trie.cpp:5:
In file included from ./Trie.h:15:
In file included from ./../cppcommon/headers.h:15:
./../cppcommon/sort_functs.h:270:37: warning: '&&' within '||'
[-Wlogical-op-parentheses]
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
./../cppcommon/sort_functs.h:270:37: note: place parentheses around the '&&'
expression to silence this warning
...(nodeL.first)==(nodeR.first)&&nodeL.second<nodeR.second;
^
( )
./../cppcommon/sort_functs.h:316:7: warning: 'stat64' is deprecated: first
deprecated in OS X 10.6 [-Wdeprecated-declarations]
if(stat64(pchFileIn, &stllFileSize)<0)
^
/usr/include/sys/stat.h:466:5: note: 'stat64' declared here
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPREC...
^
2 warnings generated.
ar rc libcppjieba.a HMMSegment.o KeyWordExt.o MPSegment.o MixSegment.o SegmentBase.o Trie.o
ar: temporary file: No such file or directory
make[1]: ** [libcppjieba.a] Error 1
make: *** [../cppjieba/libcppjieba.a] Error 2
—
Reply to this email directly or view it on GitHub.
@jcccn 解决了吗?
g++ -c -Wall -O3 keywordext_demo.cpp In file included from keywordext_demo.cpp:3: In file included from ./../cppjieba/headers.h:8: In file included from ./../cppjieba/../cppcommon/headers.h:15: ./../cppjieba/../cppcommon/sortfuncts.h:270:37: warning: '&&' within '||' [-Wlogical-op-parentheses] ...(nodeL.first)==_(nodeR.first)&&nodeL.second<nodeR.second;