我正在用C++编译一个-static程序,这样我就可以把我的程序带到服务器上运行了。服务器没有安装我要链接的所有库,当试图运行程序时,我得到一个错误,即由于没有安装libopenblas.so.0,所以找不到OpenBLAS:
error while loading shared libraries: libopenblas.so.0: cannot open shared object file: No such file or directory
我需要OpenBLAS作为线性代数库Armadillo,并使用标志进行编译。
-std=c++11 -static -pthread -Ofas
我运行以下代码
./gcc -o test -ansi test.c -L/<other dirs>/gcc/arm-linux-androideabi/4.4.3/include-fixed/
我得到..。
test.c:3:18: error: no include path in which to search for stdio.h
test.c: In function 'main':
test.c:7: warning: incompatible implicit declaration of built-in function 'printf&
我试着做一个尽可能可移植的可执行文件。删除了几个依赖项之后,在另一个系统上运行二进制文件时,我遇到了以下情况:
/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.15' not found (required by foob)
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by foob)
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (r
我需要创建一个与尽可能多的发行版一起工作的可执行文件。我阅读了很多关于这方面的信息,我发现有两种方式:静态链接和动态链接。第一种解决方案避免了随可执行文件库一起使用,但它在许可证方面存在一些问题。第二种解决方案似乎更合适。通过动态链接,链接器将它需要的库的所有引用添加到可执行的ELF头中,操作系统在执行二进制文件之前加载这些库。
命令readelf -d <binary>显示所需的库:
Dynamic section at offset 0x149d80 contains 33 entries:
Tag Type Nam
我有一个共享库,由另一个我无法控制的应用程序使用,它需要*.so对象。我的库使用了需要静态链接的sqlite3 (我绝对需要一个自包含的二进制文件)。
当我试图编译和链接我的库时:
-fpic -flto -pthread -m64
-flto -static -shared
最后会出现以下错误:
/usr/bin/ld: /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/crtbeginT.o: relocation R_X86_64_32 against `__DTOR_END__' can not be used when mak
我从源代码编译并安装了Python3.6.1,并运行sudo pip3 install readline来安装readline模块。但是,当我启动Python时,无论输入什么内容,它都会崩溃:
Python 3.6.1 (default, Mar 25 2017, 13:40:56)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("
在此之后,我尝试编译stdlib.so以将其他代码与其链接。不幸的是,stdlib.so本身是一个动态链接的二进制:
# ldd /usr/local/go/pkg/linux_amd64_dynlink/libstd.so
ldd: warning: you do not have execution permission for `/usr/local/go/pkg
/linux_amd64_dynlink/libstd.so'
linux-vdso.so.1 (0x00007ffd611d7000)
libpthread.so.0 => /lib64/lib
我的目标是能够尽可能接近地交付单个可执行文件,因此我的目标是尽可能静态地瞄准。但是我现在遇到了一些libc的问题。在构建我的项目时,我得到了以下错误:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libpthread.a(pthread_create.o): In function `allocate_stack':
/build/buildd/eglibc-2.17/nptl/allocatestack.c:465: undefined reference to `_dl_stack_flags'
/
../../lib/prebuild-octeon/libpq.a(thread.o): In function `pqGetpwuid':
thread.c:(.text+0x1c): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
../../lib/prebuild-octeon/libpq.a(ip.o): In function
我在Linux()中编写了一个C GTK程序,并在Linux mint中用 way.now编译了它。当我单击windows 10中的a.exe文件时,我将a.exe文件发送到我的windows 10计算机上以执行it.but。
the program can't start because <some files that I have listed in notepad in scrennshot> is missing from your computer.try reinstalling the program to fix this problem
我的w
我已经成功地在Linux x86_x64上构建了几个32位的静态和共享库,现在我试图将它们链接到一个可执行文件,并得到以下错误:
/usr/bin/ld: foo.so: __moddi3: invalid version 21 (max 0)
foo.so: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
其中foo.so是我构建的共享库之一。
__moddi3函数是的一部分。它的签署是:
— Runtime Function: long __moddi3 (long a, long b)
大家好,我正在尝试构建一个jni库。这个版本在windows下工作正常,但在linux fedora中,我遇到了一个问题,它抛出了一个错误,如下所示。
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbeginT.o: relocation R_X86_64_32 against `__DTOR_END__' can not be used when making a shared object; recompile with -fPIC
我用这种方式编译代码
gcc -o libTest.so -shared -I/usr