• 请不要在回答技术问题时复制粘贴 AI 生成的内容
alwayshere
V2EX  ›  程序员

编译 opencv,老是终结在“c++: internal compiler error: Segmentation fault (program cc1plus)”

  •  
  •   alwayshere · Apr 19, 2017 · 8782 views
    This topic created in 3320 days ago, the information mentioned may be changed or developed.

    centos 6.7 32 位系统,编译 opencv 3.0.0, 33%的时候就弹出一个:

    c++: internal compiler error: Segmentation fault (program cc1plus) [modules/core/CMakeFiles/opencv_core.dir/src/ocl.cpp.o] Error 1

    系统的 GCC version : 4.9.0

    cmake version: 2.8.12.2

    折腾了两天,网上各种安装方法都试过了,老是给我一个 Segmentation fault ,快被急疯了,求热心 V 友帮忙一下怎么弄

    7 replies    2017-04-19 18:16:40 +08:00
    enenaaa
        1
    enenaaa  
       Apr 19, 2017
    换 gcc 版本, 换操作系统
    alwayshere
        2
    alwayshere  
    OP
       Apr 19, 2017
    @enenaaa centos 不行吗,目前这个服务器已经是生产环境了,不敢轻易换系统啊
    skydiver
        3
    skydiver  
       Apr 19, 2017
    升级 gcc
    enenaaa
        4
    enenaaa  
       Apr 19, 2017
    @alwayshere 我的意思是, 这不是你的锅。 与其慢慢找别人犯的错, 不如简单粗暴点, 省时间精力。
    whatot
        5
    whatot  
       Apr 19, 2017
    http://pkgs.fedoraproject.org/cgit/rpms/opencv.git/
    照着这个在 centos6 上尝试 build 对应的 rpm 包吧。
    另外用 github 上的版本,在 centos6 64bit 上可以编译,没大问题。
    zcbenz
        6
    zcbenz  
       Apr 19, 2017
    你这是遇上编译器的 bug 了,不想升级系统里的编译器的话可以网上下一个编译好的 clang 或者 gcc ,然后通过设置`CC`和`CXX`变量切换到下载的版本。
    erobot
        7
    erobot  
       Apr 19, 2017
    32 位进程最大可用 4G 内存, opencv 这种复杂的库也许可能会内存不足
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1024 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 18:58 · PVG 02:58 · LAX 11:58 · JFK 14:58
    ♥ Do have faith in what you're doing.