cemu-project / Cemu

Cemu - Wii U emulator
https://cemu.info
Mozilla Public License 2.0
6.8k stars 527 forks source link

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

Closed applecuckoo closed 7 months ago

applecuckoo commented 7 months ago

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 ```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 ```

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.

Squall-Leonhart commented 7 months ago

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 7 months ago

@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 commented 7 months ago

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 7 months ago

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