I'm using centos 8Gcc
Using built-in specs.COLLECT_GCC=gccCOLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapperOFFLOAD_TARGET_NAMES=nvptx-noneOFFLOAD_TARGET_DEFAULT=1Target: x86_64-redhat-linuxConfigured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linuxThread model: posixgcc version 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)
My CMake [UPDATED]
cmake_minimum_required(VERSION 3.10)project(TestProject)set(CMAKE_CXX_STANDARD 17)set(CMAKE_CXX_FLAGS " -static -static-libgcc -static-libstdc++ -std=c++17")add_executable(TestProject main.cpp)SET(BUILD_SHARED_LIBS OFF)#--------------- Static Includes -----------------set(THREADS_PREFER_PTHREAD_FLAG ON)find_package(Threads REQUIRED)set(PHTREADS_LIB "-lphreads")#----- Include Curlset(CURL_LIBRARY "-lcurl")find_package(CURL REQUIRED)include_directories(${CURL_INCLUDE_DIR})target_link_libraries(TestProject ${CURL_LIBRARIES} ${PHTREADS_LIB})
The issue [UPDATED
/usr/bin/ld: cannot find -lcurl/usr/bin/ld: cannot find -lphreads/usr/bin/ld: cannot find -lm/usr/bin/ld: cannot find -lccollect2: error: ld returned 1 exit statusgmake[3]: *** [CMakeFiles/TestProject.dir/build.make:84: TestProject] Error 1gmake[2]: *** [CMakeFiles/Makefile2:68: CMakeFiles/TestProject.dir/all] Error 2gmake[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/TestProject.dir/rule] Error 2
My main goal is to try to add (libgcc libstdc++) as static.
Can someone guide me on what I'm doing wrong?