[Linux] Build fails with -lstdc++ error, even with libstdc++-10-dev installed #1061

Closed
opened 2024-01-12 02:37:11 -03:00 by applecuckoo · 4 comments
applecuckoo commented 2024-01-12 02:37:11 -03:00 (Migrated from github.com)

Hi! I'm building Cemu (4405116) on a 64-bit Linux Mint 21.2 (Ubuntu 22.04 based) machine with the following command

Build command
cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja

and I get this error:

FAILED: cmTC_b5c98 
: && /usr/bin/clang++-15   CMakeFiles/cmTC_b5c98.dir/testCXXCompiler.cxx.o -o cmTC_b5c98   && :
/usr/bin/ld: cannot find -lstdc++: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Seems like it's related to the libstdc++ package, but I tried installing the apt package and rebooting to no avail.

Hi! I'm building Cemu (4405116) on a 64-bit Linux Mint 21.2 (Ubuntu 22.04 based) machine with the following command <details> <summary>Build command</summary> ```text cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja ``` </details> and I get this error: ```text FAILED: cmTC_b5c98 : && /usr/bin/clang++-15 CMakeFiles/cmTC_b5c98.dir/testCXXCompiler.cxx.o -o cmTC_b5c98 && : /usr/bin/ld: cannot find -lstdc++: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. ``` Seems like it's related to the `libstdc++` package, but I tried installing the apt package and rebooting to no avail.
Squall-Leonhart commented 2024-01-12 02:45:58 -03:00 (Migrated from github.com)

clang 15 requires libstdc++-11 as it packages gcc 11.

however, if you have an nvidia gpu and recent drivers, clang 15 will use gcc 12 requiring libstdc++-12 instead.

https://stackoverflow.com/questions/74543715/usr-bin-ld-cannot-find-lstdc-no-such-file-or-directory-on-running-flutte

clang 15 requires libstdc++-11 as it packages gcc 11. however, if you have an nvidia gpu and recent drivers, clang 15 will use gcc 12 requiring libstdc++-12 instead. https://stackoverflow.com/questions/74543715/usr-bin-ld-cannot-find-lstdc-no-such-file-or-directory-on-running-flutte
applecuckoo commented 2024-01-12 04:13:53 -03:00 (Migrated from github.com)

@Squall-Leonhart Hi! Thanks for the tip. I got past that error but now I'm getting a Boost error:

CMake Error at dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake:852 (_find_package):
  Could not find a package configuration file provided by
  "boost_program_options" (requested version 1.74.0) with any of the
  following names:

    boost_program_optionsConfig.cmake
    boost_program_options-config.cmake

  Add the installation prefix of "boost_program_options" to CMAKE_PREFIX_PATH
  or set "boost_program_options_DIR" to a directory containing one of the
  above files.  If "boost_program_options" provides a separate development
  package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component)
  build/vcpkg_installed/x64-linux/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
  dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake:806 (include)
  CMakeLists.txt:129 (find_package)

I did read BUILD.md but I didn't get a very good sense of what to do to fix this.

@Squall-Leonhart Hi! Thanks for the tip. I got past that error but now I'm getting a Boost error: ```text CMake Error at dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake:852 (_find_package): Could not find a package configuration file provided by "boost_program_options" (requested version 1.74.0) with any of the following names: boost_program_optionsConfig.cmake boost_program_options-config.cmake Add the installation prefix of "boost_program_options" to CMAKE_PREFIX_PATH or set "boost_program_options_DIR" to a directory containing one of the above files. If "boost_program_options" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package) /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component) build/vcpkg_installed/x64-linux/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package) dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake:806 (include) CMakeLists.txt:129 (find_package) ``` I did read BUILD.md but I didn't get a very good sense of what to do to fix this.
Squall-Leonhart commented 2024-01-12 05:15:52 -03:00 (Migrated from github.com)

to clear that up, you'll need libboost-program-options1.74-dev and fixing this will expose the lack of libboost-nowide1.74-dev too.

to clear that up, you'll need libboost-program-options1.74-dev and fixing this will expose the lack of libboost-nowide1.74-dev too.
applecuckoo commented 2024-01-12 15:20:49 -03:00 (Migrated from github.com)

Thanks for the help, I managed to find all the Boost dependencies and complete the build!

Thanks for the help, I managed to find all the Boost dependencies and complete the build!
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: cemu-project_Mirror/Cemu-2024-03-05#1061
No description provided.