rdnetto / YCM-Generator

Generates config files for YouCompleteMe (https://github.com/Valloric/YouCompleteMe)
GNU General Public License v3.0
917 stars 129 forks source link

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

Open galou opened 7 years ago

galou commented 7 years ago

I have an issue when trying to use YCM-Generator.

CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
PROJECT(ParticleFilter)

SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g")
add_definitions("-std=c++11")

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

add_subdirectory(dataLoader)
set(LIBS LaserDataLoader)

add_subdirectory(gui)
set(LIBS ${LIBS} Gui)

add_subdirectory(laserSimulator)
set(LIBS ${LIBS} lasersimulator)

include_directories ("${PROJECT_SOURCE_DIR}")

add_executable(ParticleFilter pf_main.cpp)
target_link_libraries(ParticleFilter ${LIBS} ${VTK_LIBRARIES})

Verbose output

Running cmake in '/tmp/tmprs13Fl'...
$ cmake /home/gael/20-teaching/a3m33mkr-mkr/2016-2017/2-results/koranga-raman/pf
-- The C compiler identification is Clang 3.3.0
-- The CXX compiler identification is Clang 3.3.0
-- Check for working C compiler: /home/gael/.vim/bundle/repos/github.com/rdnetto/YCM-Generator/fake-toolchain/Unix/clang
-- Check for working C compiler: /home/gael/.vim/bundle/repos/github.com/rdnetto/YCM-Generator/fake-toolchain/Unix/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/gael/.vim/bundle/repos/github.com/rdnetto/YCM-Generator/fake-toolchain/Unix/clang++
-- Check for working CXX compiler: /home/gael/.vim/bundle/repos/github.com/rdnetto/YCM-Generator/fake-toolchain/Unix/clang++ -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
  The C++ compiler
  "/home/gael/.vim/bundle/repos/github.com/rdnetto/YCM-Generator/fake-toolchain/Unix/clang++"
  is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /tmp/tmprs13Fl/CMakeFiles/CMakeTmp

  Run Build Command:/usr/bin/make "cmTryCompileExec820819319/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec820819319.dir/build.make
  CMakeFiles/cmTryCompileExec820819319.dir/build

  make[1]: Entering directory `/tmp/tmprs13Fl/CMakeFiles/CMakeTmp'

  /usr/bin/cmake -E cmake_progress_report
  /tmp/tmprs13Fl/CMakeFiles/CMakeTmp/CMakeFiles 1

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

  /home/gael/.vim/bundle/repos/github.com/rdnetto/YCM-Generator/fake-toolchain/Unix/clang++
  -o CMakeFiles/cmTryCompileExec820819319.dir/testCXXCompiler.cxx.o -c
  /tmp/tmprs13Fl/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

  Linking CXX executable cmTryCompileExec820819319

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

  /home/gael/.vim/bundle/repos/github.com/rdnetto/YCM-Generator/fake-toolchain/Unix/clang++
  CMakeFiles/cmTryCompileExec820819319.dir/testCXXCompiler.cxx.o -o
  cmTryCompileExec820819319 -rdynamic

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

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

  make[1]: *** [cmTryCompileExec820819319] Error 1

  make[1]: Leaving directory `/tmp/tmprs13Fl/CMakeFiles/CMakeTmp'

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

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

-- Configuring incomplete, errors occurred!
See also "/tmp/tmprs13Fl/CMakeFiles/CMakeOutput.log".
See also "/tmp/tmprs13Fl/CMakeFiles/CMakeError.log".

Running make...
$ make -i -j4
make: *** No targets specified and no makefile found.  Stop.

Cleaning up...

Build completed in 0.35 sec

Collected 0 relevant entries for C compilation (0 discarded).
Collected 0 relevant entries for C++ compilation (0 discarded).

ERROR: No commands were logged to the build logs (C: /tmp/tmpq56jpM, C++: /tmp/tmpvwLrsG).
Your build system may not be compatible.

Thanks for help!

tistatos commented 7 years ago

EDIT: Had the issue but solved it.

It seems as it occurred after I did a dist-upgrade on my machine. libstdc++.so was missing from /usr/lib/

Creating symlink from /usr/lib/x86_64-linux-gnu/libstdc++.so solved my issue