shared-libraries

adding “-rpath,/usr/lib” in the build options of a shared library cause a segfault

我只是一个虾纸丫 提交于 2019-12-08 15:53:19
问题 I have a hello world program. #include <stdio.h> #include <stdlib.h> int main() { printf("hello world! \n"); return 0; } I add -lmicroxml in the build of the program in the linkage phase in order to link to the library libmicroxml.so when I launch my program I get a segmentation fault. the segmentation fault is related to the load of the libmicroxml.so . here after the strace of my helleo world program execution: strace ./test execve("./test", ["./test"], [/* 11 vars */]) = 0 old_mmap(NULL,

Creating a shared library that statically includes ffmpeg

☆樱花仙子☆ 提交于 2019-12-08 13:22:57
问题 I'm having hard time trying to create a shared library that has ffmpeg libraries "baked in" as static ones. Consider the following directory schema: include/ my own .h files ext/ ffmpeg .h files lib/ libav*.a archive files (softlinks to the actual .a files) libValkka.so (my shared library) test/ mytest.cpp bin/ (binaries appear here) I've come a long way (see Including objects to a shared library from a C++ archive (.a) ) and the library compiles ok with this: ([STUFF] has been omitted for

Is there an interface between delphi and Android NDK?

空扰寡人 提交于 2019-12-08 12:50:55
问题 I want to create a C library that calls some NDK functions and access these functions in Delphi. Does anyone know where i can find how to do that? I could not find information about it. Interfacing via Java/JNI seems a big detour. 来源: https://stackoverflow.com/questions/20923013/is-there-an-interface-between-delphi-and-android-ndk

Running multiple applications on a shared process with a shared project library

大憨熊 提交于 2019-12-08 12:37:27
问题 I have a set of applications that run in the same process. These processes have a shared libary, the ActionBarSherlock so that they have the same UI accross different versions of Android. The first time i access elements of the ActionBarSherlock library everything works fine. But when i access the same elements from a different application on the same Android process, i get an error like this: E/AndroidRuntime( 797): java.lang.RuntimeException: Unable to start activity \ ComponentInfo{xper

how to link with two shared libraries with many conflicting functions

自古美人都是妖i 提交于 2019-12-08 12:28:32
问题 I'm currently linking with two third party shared libraries (A.so and B.so) on linux. the problem is that both of the two so's linked statically with another library, as a result there are about 400 functions from A.so and B.so having the same names. When I compile and link with -lA -lB, or -lB -lA, depending on the order the functions are picked up from A or B separately as a result of function interposition which caused problem and the code cannot run. I'm wondering if there's a way to bind

CMake: build target library if any of the executable targets needs it

Deadly 提交于 2019-12-08 12:11:32
问题 The layout of my project is as follow : src/ include/ include1.h include2.h include3.h lib/ lib1/ source1_lib1.c source2_lib1.c lib2/ source1_lib2.c source2_lib2.c source3_lib2.c lib3/ source1_lib3.c lib4/ source1_lib4.c source2_lib4.c module_A/ (this module will need lib1 and lib4) source1_moduleA.c source2_moduleA.c module_B/ (this module will need lib2 and lib3) source1_moduleB.c source2_moduleB.c source3_moduleB.c module_C/ (this module will need lib1, lib2, lib3 and lib4) source1_moduleC

suppressing compile time linkage of shared libraries

蓝咒 提交于 2019-12-08 11:54:07
问题 I am integrating a DRM library that cannot be persisted in a code repository in the clear for security reasons. The DRM library will only be in the clear at run time when on the secure target device, thus it will only be available for linking at runtime. This presents a problem for compile time linking. For example, if I am creating my_library.so which depends on the DRM lib, libDrm.so, the following will fail if I simply remove the libDrm.so from the build with "ld: cannot find -lDrm" gcc

How to check what shared libraries are loaded at run time for a given process?

南笙酒味 提交于 2019-12-08 11:08:43
问题 Is there a way to check which libraries is a running process using? To be more specific, if a program loads some shared libraries using dlopen, then readelf or ldd is not going to show it. Is it possible at all to get that information from a running process? If yes, how? 回答1: Other people are on the right track. Here are a couple ways. cat /proc/NNNN/maps | awk '{print $6}' | grep '\.so' | sort | uniq Or, with strace: strace CMD.... 2>&1 | grep '^open(".*\.so"' Both of these assume that

Build Cython-compiled modules and python code into executable binary using PyInstaller

梦想与她 提交于 2019-12-08 10:37:41
问题 I am trying to package my project code into a an executable binary using Cython and PyInstaller libraries. My code directory looks like this: The main.py is the main code which imports the logic from program_a.py and program_b.py . I am successfully able to convert my program_a and program_b files into .so files which can be imported by any python code. I did this by executing the following script. from distutils.core import setup from Cython.Build import cythonize sourcefiles = ['program_a

How to get name of dynamically loaded library in linux from within the library that has been opened using ::dlopen?

跟風遠走 提交于 2019-12-08 09:39:10
问题 in windows one can use GetModuleFileName. what about linux? 回答1: dladdr() is a non-standard (not part of POSIX) function that works on most Linux boxes and in OSX. Since it is non standard there are no guarantees, but it should be there since you specified Linux. 来源: https://stackoverflow.com/questions/10305428/how-to-get-name-of-dynamically-loaded-library-in-linux-from-within-the-library-t