简体   繁体   English

错误:命令“ c ++”失败,退出状态为1

[英]error: command 'c++' failed with exit status 1

So I am trying to install Pyv8 by following instruction from https://andrewwilkinson.wordpress.com/2012/01/23/integrating-python-and-javascript-with-pyv8/ 所以我正在尝试按照https://andrewwilkinson.wordpress.com/2012/01/23/integrating-python-and-javascript-with-pyv8/中的说明安装Pyv8


    sudo aptitude install scons libboost-python-dev
    svn checkout http://v8.googlecode.com/svn/trunk/ v8
    svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8
    cd v8
    export PyV8=`pwd`
    cd ../pyv8
    python setup.py build
    sudo python setup.py install

Error comes when running second last command about building the setup. 运行有关构建设置的倒数第二条命令时出现错误。


    -Wstrict-prototypes -fPIC -DBOOST_PYTHON_STATIC_LIB -
    DV8_NATIVE_REGEXP -DENABLE_DEBUGGER_SUPPORT -DV8_TARGET_ARCH_X64 -
    I/home/amit/Downloads/pyv8/build/v8_r19632/include -
    I/home/amit/Downloads/pyv8/build/v8_r19632 -
    I/home/amit/Downloads/pyv8/build/v8_r19632/src -I/usr/local/include -
    I/usr/include/python2.7 -c src/PyV8.cpp -o build/temp.linux-x86_64-
    2.7/src/PyV8.o -Wno-write-strings -g -O3
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for 
    C/ObjC but not for C++ [enabled by default]
    c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-
    functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
    -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-
    buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-
    2.7/src/Utils.o build/temp.linux-x86_64-2.7/src/Exception.o 
    build/temp.linux-x86_64-2.7/src/Context.o build/temp.linux-x86_64-
    2.7/src/Engine.o build/temp.linux-x86_64-2.7/src/Wrapper.o 
    build/temp.linux-x86_64-2.7/src/Debug.o build/temp.linux-x86_64-
    2.7/src/Locker.o build/temp.linux-x86_64-2.7/src/AST.o     build/temp.linux-
    x86_64-2.7/src/PrettyPrinter.o build/temp.linux-x86_64-2.7/src/PyV8.o 
    L/usr/local/lib -
    L/home/amit/Downloads/pyv8/build/v8_r19632/out/x64.release/obj.target/tool
    s/gyp/ -lboost_python -lboost_thread -lboost_system -lrt -lv8_base.x64 -
    lv8_snapshot -o build/lib.linux-x86_64-2.7/_PyV8.so -fPIC -lrt
    /usr/bin/ld: cannot find -lboost_thread
    /usr/bin/ld: cannot find -lboost_system
    collect2: error: ld returned 1 exit status

    error: command 'c++' failed with exit status 1

It is because the version of gcc and g++ is too low for me, as I downgrade it when i install cuda sometime. 这是因为gcc和g ++的版本对我来说太低了,因为我有时安装cuda时会对其降级。 Just follow the following commands: 只需遵循以下命令:

$ cd /usr/bin 
$  rm gcc
$ ln -s gcc-5 gcc  
$ rm g++
$ ln -s g++-5 g++ 

Done. 做完了

I followed the instructions from this link - http://ubuntuforums.org/showthread.php?t=1480282#post_11247864 and installed the libboost_thread package which solved the problem. 我跟着从这个链接的说明- http://ubuntuforums.org/showthread.php?t=1480282#post_11247864和安装的解决了这个问题的libboost_thread包。 Thank you https://stackoverflow.com/users/440558/joachim-pileborg 谢谢https://stackoverflow.com/users/440558/joachim-pileborg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM