shared-libraries

How do I modify the install name of a .dylib at build time

杀马特。学长 韩版系。学妹 提交于 2019-12-29 06:19:31
问题 I am building the google-gflags commandline flags library for C++ on Mac OS X (10.7.1). The build process is as such: $ ./configure --prefix=output $ make $ make install I'd like to change the install name of the generated shared library at build time and not use install_name_tool afterwards. By default, the install name of the generated shared library, libgflags.dylib , is the output path: $ otool -L ./output/libgflags.dylib $ ./output/libgflags.dylib: /tmp/gflags-1.5/output/lib/libgflags.0

shared library address space

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-29 04:03:11
问题 While I was studying about shared library I read a statement Although the code of a shared library is shared among multiple processes, its variables are not. Each process that uses the library has its own copies of the global and static variables that are defined within the library. I just have few doubts. Whether code part of each process are in separate address space? Whether shared-library code part are in some some global(unique) address space. I am just a starter so please help me

LD_LIBRARY_PATH, the shared lib path in linux

爱⌒轻易说出口 提交于 2019-12-29 01:45:09
问题 I wrote a shared object, say libsd.so , and I put libsd.so and its header file sd.h in ~/lib . Here is another program using libsd.so , say test.c , then compile it like this: $ gcc -o test test.c -I~/lib -L~/lib -lsd Then I run test like this: $ ./test ./test_sd: error while loading shared libraries: libsd.so: cannot open shared object file: No such file or directory So I set export LD_LIBRARY_PATH=. , then it works. But if I unset LD_LIBRARY_PATH and put LD_LIBRARY_PATH=~/lib in my ~/

Binary compatibility over what range of machines?

隐身守侯 提交于 2019-12-29 01:40:10
问题 I wrote a simple program in C and compiled it using GCC on Ubuntu. Will this file work on another machine? What are the contents of the output binary, and its external dependencies? Can it be run on other Linux distributions, and under what circumstances? Can it be run on other operating systems? 回答1: There are several levels/sources of binary incompatibility. Firstly, addressing library incompatibility Normally, if you're running a binary on another machine, with a different version of the

How can I change the filename of a shared library after building a program that depends on it?

◇◆丶佛笑我妖孽 提交于 2019-12-28 08:10:12
问题 I have a program that depends on a shared library it expects to find deep inside a directory structure. I'd like to move that shared library out and into a better place. On OS X, this can be done with install_name_tool. I'm unable to find an equivalent for Linux. For reference, readelf -d myprogram spits out the following paraphrased output: Dynamic section at offset 0x1e9ed4 contains 30 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [this/is/terrible/library.so] 0x00000001

FFmpeg command for crossfading between 5 videos .How to manage setpts=PTS-STARTPTS?

核能气质少年 提交于 2019-12-28 07:07:09
问题 Here, New in FFmpeg . I am using and testing in console in FFmpeg . I already done with 2 video join with cross fading with this question : I am doing for 5 videos merging with cross fade I just done 90% in merging i just need to manage setpts=PTS-STARTPTS Just look into this pls. ffmpeg -i big_buck.mp4 -i big_buck.mp4 -i big_buck.mp4 -i big_buck.mp4 -i big_buck.mp4 -filter_complex "[0:v]trim=0:4,setpts=PTS- STARTPTS,fade=out:st=4:d=1:alpha=1[1]; [1:v]trim=1:4,setpts=PTS- STARTPTS,format

libpython2.7.so.1.0: cannot open shared object file: No such file or directory

岁酱吖の 提交于 2019-12-28 06:28:16
问题 I have trying to run python script from the terminal but getting the next error message : ImportError: libpython2.7.so.1.0: cannot open shared object file: No such file or directory if I run print sys.version I get : >>> import sys >>> print sys.version 2.7.3 (default, Feb 26 2013, 16:27:39) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] and if I run ldd /usr/local/bin/python >> ldd /usr/local/bin/python linux-vdso.so.1 => (0x00007fff219ff000) libpthread.so.0 => /lib64/libpthread.so.0

What is a file with extension .a?

被刻印的时光 ゝ 提交于 2019-12-28 04:54:08
问题 I downloaded this: https://github.com/mongodb/mongo-c-driver And now I'm trying to use it inside my C program, but I don't know what to do with the generated .a files. What are they? I couldn't find any information, not even in the GCC manual. And I built it like so: scons --c99 Also, can I use C99 libraries with my C89 program? 回答1: .a files are static libraries typically generated by the archive tool. You usually include the header files associated with that static library and then link to

What does exactly the warning mean about hidden symbol being referenced by DSO?

本小妞迷上赌 提交于 2019-12-28 04:00:09
问题 I have a problem linking some shared library with g++. It gives me a warning like: hidden symbol XXX in YYY is referenced by DSO /usr/lib/... I've read some related questions about particular problems, but I want to understand it in a whole - what does this warning mean and what is a cause: What is DSO? What is a hidden symbol? How can it be referenced, if it's hidden? 回答1: What is a DSO? A DSO is a Dynamic Shared Object , or less formally a shared library. What is a hidden symbol? A hidden

Compilation fails with “relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object”

别来无恙 提交于 2019-12-27 12:15:26
问题 I'm trying to compile this source code from the makefile in a VPS, but its not working. The VPS is a 64 Cent OS Here's the full error # make gcc -c -O3 -w -DLINUX -I../SDK/amx/ ../SDK/amx/*.c g++ -c -O3 -w -DLINUX -I../SDK/amx/ ../SDK/*.cpp g++ -c -O3 -w -DLINUX -I../SDK/amx/ *.cpp g++ -O2 -fshort-wchar -shared -o "TCP_V1.so" *.o /usr/bin/ld: TCP-LINUX_V1.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC TCP-LINUX_V1.o: could