Проблема линкера уже несколько дней преследует меня без успеха. Я попробовал несколько разных способов установления пути библиотеки, но все еще лингер не может найти стандартные библиотеки. Все необходимые библиотеки и их зависимости находятся в /lib64, который является пути для LD_Library_Path. Я начал верить, что что -то не так с самим ядром, и я хотел бы спросить вас, если я что -то не знаю, прежде чем переключаться на другое распределение Linux. Я что -то здесь упускаю? Я скопировал команды и их версии ниже < /p>
ОС: Oracle Linux 8 < /p>
[root@alpha src]# gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-26.0.1)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@alpha src]# which ld
/usr/bin/ld
[root@alpha src]# ld --version
GNU ld version 2.30-125.0.1.el8_10
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
[root@alpha x86_64]# ld -ldl --verbose
GNU ld version 2.30-125.0.1.el8_10
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
elf_iamcu
i386linux
elf_l1om
elf_k1om
i386pep
i386pe
using internal linker script:
==================================================
attempt to open //usr/x86_64-redhat-linux/lib64/libdl.so succeeded
-ldl (//usr/x86_64-redhat-linux/lib64/libdl.so)
libc.so.6 needed by //usr/x86_64-redhat-linux/lib64/libdl.so
attempt to open //usr/lib64/llvm17/lib/libc.so.6 failed
attempt to open //usr/local/lib64/libc.so.6 failed
attempt to open //usr/x86_64-redhat-linux/lib/libc.so.6 failed
attempt to open //usr/local/lib/libc.so.6 failed
found libc.so.6 at /lib64/libc.so.6
ld-linux-x86-64.so.2 needed by //usr/x86_64-redhat-linux/lib64/libdl.so
found ld-linux-x86-64.so.2 at /lib64/ld-linux-x86-64.so.2
ld: warning: cannot find entry symbol _start; not setting start address
[root@alpha x86_64]# echo $LD_LIBRARY_PATH
/lib64:/lib
[root@alpha x86_64]# gcc -v -m64 -g -static -o petsample-1.0 petsample/petsample.o petsample/interactive_script.o petsample/kernel_shutdown_script.o petsample/kernel_startup_script.o -L/alpha/app/petsample/petsample/src/release/x86_64 -lPetSample -lUtility -lModel -lKernel -L/lib64 -ldl -lm -lpthread -lstdc++
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured 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-linux
Thread model: posix
gcc version 8.5.0 20210514 (Red Hat 8.5.0-26.0.1) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-m64' '-g' '-static' '-o' 'petsample-22.2' '-L/alpha/app/petsample/petsample/src/release/x86_64' '-L/lib64' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/8/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper -plugin-opt=-fresolution=/tmp/cchPwWW9.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc --build-id --no-add-needed --hash-style=gnu -m elf_x86_64 -static -o petsample-22.2 /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/8/crtbeginT.o -L/alpha/app/petsample/petsample/src/release/x86_64 -L/lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../.. petsample/petsample.o petsample/interactive_script.o petsample/kernel_shutdown_script.o petsample/kernel_startup_script.o -lPetSample -lUtility -lModel -lKernel -ldl -lm -lpthread -lstdc++ --start-group -lgcc -lgcc_eh -lc --end-group /usr/lib/gcc/x86_64-redhat-linux/8/crtend.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
[root@alpha x86_64]#
Подробнее здесь: https://stackoverflow.com/questions/796 ... -libraries
Лингер GCC не может найти доступные библиотеки ⇐ C++
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как я могу настроить лингер в Cmake, чтобы он использовал G ++ вместо AR+C ++?
Anonymous » » в форуме C++ - 0 Ответы
- 2 Просмотры
-
Последнее сообщение Anonymous
-