Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error: "/usr/bin/ld: cannot find -lstdc++fs: No such file or directory" #581

Open
oliverkurth opened this issue Jun 29, 2023 · 3 comments

Comments

@oliverkurth
Copy link

I am trying to build an RPM for ET in Photon 5.0, but I am running into this error:

[ 84%] Linking CXX executable htm
/usr/bin/cmake -E cmake_link_script CMakeFiles/htm.dir/link.txt --verbose=1
/usr/bin/c++ -O2 -g -DUSE_SENTRY -DELPP_NO_DEFAULT_LOG_FILE -DELPP_FEATURE_CRASH_LOG -DELPP_THREAD_SAFE -DELPP_STRICT_PERMISSIONS -DSENTRY_BUILD_STATIC -g -ggdb3 -DWITH_UTEMPTER -rdynamic CMakeFiles/htm.dir/src/htm/HtmClientMain.cpp.o -o htm  libHtmCommon.a libet-lib.a -lprotobuf-lite -lsodium -lutempter external_imported/sentry-native/libsentry.a /usr/lib/libssl.so /usr/lib/libz.so -lutil -lresolv -latomic -lstdc++fs /usr/lib/libcurl.so -Wl,-E,--build-id=sha1 -ldl -lrt external_imported/sentry-native/external/libbreakpad_client.a /usr/lib/libcrypto.so 
/usr/bin/ld: cannot find -lstdc++fs: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/htm.dir/build.make:120: htm] Error 1
make[2]: Leaving directory '/usr/src/photon/BUILD/EternalTerminal-et-v6.2.1/x86_64-vmware-linux'
make[1]: *** [CMakeFiles/Makefile2:707: CMakeFiles/htm.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

I have the following build requires in the spec file:

BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  gflags-devel
BuildRequires:  curl-devel
BuildRequires:  libsodium-devel
BuildRequires:  libstdc++-devel
BuildRequires:  libutempter-devel
BuildRequires:  ncurses-devel
BuildRequires:  openssl-devel
BuildRequires:  protobuf-devel
BuildRequires:  protobuf-c-static
BuildRequires:  protobuf-c-devel
BuildRequires:  systemd
BuildRequires:  zlib-devel

But it looks like there is something missing. I found this though with Google: https://stackoverflow.com/questions/74891427/make-error-library-not-found-for-lstdcfs , indicating it should actually not be necessary. Our version of libstdc++ is 12.2.0:

root [ ~ ]# tdnf info libstdc++-devel
Name          : libstdc++-devel
Arch          : x86_64
Epoch         : 0
Version       : 12.2.0
Release       : 1.ph5
...
@oliverkurth
Copy link
Author

oliverkurth commented Jul 1, 2023

I could fix this by removing stdc++fs from CMakeLists.txt:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47320878..39730bac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -274,7 +274,7 @@ else()
       util
       resolv
       atomic
-      stdc++fs)
+      )
 endif()
 
 IF(Unwind_FOUND)

A proper fix should probably involve checking for the libstdc++ version.

@oliverkurth
Copy link
Author

oliverkurth commented Dec 12, 2023

Issue still exists in 6.2.8.

/usr/bin/c++ -O2 -g -DUSE_SENTRY -DELPP_NO_DEFAULT_LOG_FILE -DELPP_FEATURE_CRASH_LOG -DELPP_THREAD_SAFE -DELPP_STRICT_PERMISSIONS -DSENTRY_BUILD_STATIC -g -ggdb3 -DWITH_UTEMPTER -rdynamic "CMakeFiles/et-test.dir/test/BackedTest.cpp.o" "CMakeFiles/et-test.dir/test/ConnectionTest.cpp.o" "CMakeFiles/et-test.dir/test/CryptoHandlerTest.cpp.o" "CMakeFiles/et-test.dir/test/JumphostTest.cpp.o" "CMakeFiles/et-test.dir/test/ServerFifoPathTest.cpp.o" "CMakeFiles/et-test.dir/test/TerminalTest.cpp.o" "CMakeFiles/et-test.dir/test/Main.cpp.o" -o et-test  -Wl,-rpath,/usr/src/photon/BUILD/EternalTerminal-et-v6.2.8/x86_64-vmware-linux/external_imported/Catch2/src libTerminalCommon.a libet-lib.a external_imported/Catch2/src/libCatch2Main.so.3.3.2 -lprotobuf -lsodium -lutempter external_imported/sentry-native/libsentry.a /usr/lib/libssl.so /usr/lib/libcrypto.so /usr/lib/libz.so -lutil -lresolv -latomic -lstdc++fs external_imported/Catch2/src/libCatch2.so.3.3.2 /usr/lib/libcurl.so -ldl -lrt external_imported/sentry-native/external/libbreakpad_client.a 
/usr/bin/ld: cannot find -lstdc++fs: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/et-test.dir/build.make:230: et-test] Error 1
make[2]: Leaving directory '/usr/src/photon/BUILD/EternalTerminal-et-v6.2.8/x86_64-vmware-linux'
make[1]: *** [CMakeFiles/Makefile2:929: CMakeFiles/et-test.dir/all] Error 2
make[1]: Leaving directory '/usr/src/photon/BUILD/EternalTerminal-et-v6.2.8/x86_64-vmware-linux'
make: *** [Makefile:169: all] Error 2

@MisterTea
Copy link
Owner

Is this issue still present in 6.2.9?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants