简体   繁体   English

在Ubuntu 14.04上构建opencv时出错[找不到-lstdc ++]

[英]Error to build opencv on Ubuntu 14.04 [cannot find -lstdc++]

I'm new to build and install opencv on my Ubuntu 14.04. 我是在Ubuntu 14.04上构建和安装opencv的新手。

I follow pyimagesearch to do it. 我按照pyimagesearch来做。

After typing cmake command, I encounter some errors as follows. 键入cmake命令后,遇到如下错误。 I google some solutions and try to reinstall some packages, ex: gcc . 我用Google搜索了一些解决方案,并尝试重新安装一些软件包,例如: gcc

Still can not work... :( 仍然不能工作... :(

for /usr/bin/ld: cannot find -lstdc++ problem, anyone has ideas? 对于/usr/bin/ld: cannot find -lstdc++问题,有人有想法吗?

thank you :) 谢谢 :)

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D INSTALL_C_EXAMPLES=OFF \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D OPENCV_EXTRA_MODULES_PATH=/home/eric/program_files/OpenCV/opencv_contrib/modules \
    -D BUILD_EXAMPLES=ON ..
-- The CXX compiler identification is Clang 3.4.0
-- The C compiler identification is GNU 4.8.5
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/clang++" is not able to compile a simple test
program.

It fails with the following output:

Change Dir: 
/home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec3807027872/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3807027872.dir/build.make
CMakeFiles/cmTryCompileExec3807027872.dir/build



make[1]: Entering directory
  `/home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp'

  /usr/bin/cmake -E cmake_progress_report
  /home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building CXX object
  CMakeFiles/cmTryCompileExec3807027872.dir/testCXXCompiler.cxx.o

  /usr/bin/clang++ -o
  CMakeFiles/cmTryCompileExec3807027872.dir/testCXXCompiler.cxx.o -c
  /home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx


  Linking CXX executable cmTryCompileExec3807027872

  /usr/bin/cmake -E cmake_link_script
  CMakeFiles/cmTryCompileExec3807027872.dir/link.txt --verbose=1

  /usr/bin/clang++
  CMakeFiles/cmTryCompileExec3807027872.dir/testCXXCompiler.cxx.o -o
  cmTryCompileExec3807027872 -rdynamic

  /usr/bin/ld: cannot find -lstdc++

  clang: error: linker command failed with exit code 1 (use -v to see
  invocation)

  make[1]: *** [cmTryCompileExec3807027872] Error 1

  make[1]: Leaving directory
  `/home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec3807027872/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:88 (project)


-- Configuring incomplete, errors occurred!

try: 尝试:

sudo apt-get install g++

or 要么

ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so

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

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