簡體   English   中英

“未知類型名稱'decltype'”:在Mac上安裝pyicu失敗,出現gcc錯誤

[英]“unknown type name 'decltype'”: Installing pyicu on mac failed, with gcc error

我運行了以下命令(因為我的Mac上同時擁有python2和python3):

$ CFLAGS = -I / usr / local / opt / icu4c / include LDFLAGS = -L / usr / local / opt / icu4c / lib sudo python3 -m pip install pyicu

錯誤信息如下:

安裝收集的軟件包:pyicu為pyicu運行setup.py安裝...錯誤從命令/ anaconda3 / bin / python3 -u -c“ import setuptools,tokenize; file ='/ private / tmp / pip-build-l71tm0m4 / pyicu / setup.py'; f = getattr(tokenize,'open',open)( file ); code = f.read()。replace('\\ r \\ n','\\ n'); f.close( ); exec(compile(code, file ,'exec'))“ install --record /tmp/pip-7298jccr-record/install-record.txt --single-version-externally-managed --compile:

Building PyICU 2.0.3 for ICU 58.2

Adding CXXFLAGS="-I/anaconda3/include" from /anaconda3/bin/icu-config
Adding LDFLAGS="-Wl,-rpath,/anaconda3/lib -L/anaconda3/lib -licui18n -licuuc -licudata" from /anaconda3/bin/icu-config
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying PyICU.py -> build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/icu
copying icu/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/icu
running build_ext
building '_icu' extension
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.6m -c _icu.cpp -o build/temp.macosx-10.7-x86_64-3.6/_icu.o -DPYICU_VER="2.0.3" -I/anaconda3/include
In file included from _icu.cpp:27:
./common.h:38:13: error: unknown type name 'decltype'
    typedef decltype(nullptr) nullptr_t;
            ^
./common.h:38:30: error: expected ';' after top level declarator
    typedef decltype(nullptr) nullptr_t;
                             ^
                             ;
2 errors generated.
error: command 'gcc' failed with exit status 1

----------------------------------------

命令“ / anaconda3 / bin / python3 -u -c”導入設置工具,標記化; 文件 ='/ private / tmp / pip-build-l71tm0m4 / pyicu / setup.py'; f = getattr(tokenize,'open',open)( file ); code = f.read()。replace('\\ r \\ n','\\ n'); f.close(); exec(compile(code, file ,'exec')))“安裝--record /tmp/pip-7298jccr-record/install-record.txt- “單一版本外部管理的--compile”失敗,錯誤代碼為/ private / tmp / pip-build-l71tm0m4 / pyicu /

根據@nm,需要將-std=c++11添加到CFLAGS。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM