shared-libraries

Creating symlinks when packaging a Library (Debian)?

こ雲淡風輕ζ 提交于 2019-12-04 10:35:48
I'm trying for the first time to package for Debian a small library. For this, I'm using the official Debian Policy manual but since two days I encounter an issue than I cannot fix. This is the way I'm packaging : Creating the tarball (here libvl_1.0.orig.tar.gz) Using dh_make to generate the debian conf file in the debian directory Modifying the control file, changelog and copyright properly. Building the package using the dpkg-buildpackage command. Up to here, there is no problem. But as it is a library, I need to create some symlinks while installing it, this related to the SONAME of the

Including objects to a shared library from a C++ archive (.a)

痞子三分冷 提交于 2019-12-04 10:35:03
I am trying to include some object files into a shared library I am building. Take the following command (things in [ETC] have been omitted for brevity): /usr/bin/c++ -fPIC -std=c++14 -pthread -Iinclude/ext/liveMedia -Iinclude/ext/groupsock [ETC] -g -shared -Wl,-soname,libValkka.so -o lib/libValkka.so CMakeFiles/Valkka.dir/src/avthread.cpp.o CMakeFiles/Valkka.dir/src/opengl.cpp.o [ETC] CMakeFiles/Valkka.dir/src/decoders.cpp.o -lX11 -lGLEW -lGLU -lGL -Wl,--whole-archive lib/libavcodec.a -Wl,--no-whole-archive So basically I am just creating a shared library where most of the objects come from

How to share code between multiple projects with angularJS

女生的网名这么多〃 提交于 2019-12-04 10:08:09
问题 I was wondering what would be the best practice to share common libraries and own modules between multiple angularJS projects. Let's assume that I'm working on two different projects. Both rely on libraries like angularJS, bootstrap etc. I have a file structure like below: Project 1 index.html css js module A module B lib angular bootstrap Project 2 index.html css js module B module X lib angular bootstrap So I was thinking about just creating another directory with all the shared components

How to set the dynamic linker path for a shared library?

半世苍凉 提交于 2019-12-04 10:02:05
I want to compile a shared library with an .interp segment. #include <stdio.h> int foo(int argc, char** argv) { printf("Hello, world!\n"); return 0; } I'm using the following commands. gcc -c -o test.o test.c ld --dynamic-linker=blah -shared -o test.so test.o I end up without an INTERP segment, as if I never passed the --dynamic-linker=blah option. Check with readelf -l test.so . When building an executable, the linker processes the option correctly and puts an INTERP segment in the program header. How to do I make it work for shared libraries too? jacwah ld doesn't include a .interp section

Why LD_PRELOAD doesn't work for one of loaded shared libraries?

ぐ巨炮叔叔 提交于 2019-12-04 09:58:04
I have an in-house shared library on RedHat Linux 5.0 that provides functions free and malloc : >nm ./libmem_consumption.so | grep -P -e "\bfree\b|\bmalloc\b" 0000000000006540 T free 00000000000088a0 T malloc This shared library is responsible for providing information about memory consumption of a process. Unfortunatelly there is a problem with this shared library when it is used with Apache httpd . When Apache httpd is run with this library I get a coredump in libc::free and a message that the pointer is invalid. The problem seems to be in http.so which is a shared library loaded by libphp5

How does linker find shared library without SONAME

筅森魡賤 提交于 2019-12-04 09:16:07
if I create a shared library without a SONAME like this gcc -shared libfoo.o -o libfoo.so and link against it, how does the linker find my shared library? Is the filename libfoo.so considered as default SONAME by the linker? I think you're right. Here what ld man pages say: -soname=name When creating an ELF shared object, set the internal DT_SONAME field to the specified name. When an executable is linked with a shared object which has a DT_SONAME field, then when the executable is run the dynamic linker will attempt to load the shared object specified by the DT_SONAME field rather than the

Shared Library Path as Executable Directory

社会主义新天地 提交于 2019-12-04 08:41:27
问题 I have an application that is broken into several libraries for purposes of code reuse. On Windows all I have to do is put the .dll files in the same path as the executable and it automatically finds them. On Linux (since it hardcodes the paths to things) I have to specify the environmental variable LD_LIBRARY_PATH or preload the libraries before the executable. I've seen some things about embedding the path using the linker option of -Wl,-rpath=<PATH> and I've tried it using . as the path.

Why is my Linux application pulling in the wrong .so library?

亡梦爱人 提交于 2019-12-04 08:28:59
I have an application I'm building that's using the NetCDF C++ library, and NetCDF is pulling in the HDF-4 libary. However, it's pulling in the wrong HDF-4 library. Here's how my app is linked: /apps1/intel/bin/icpc -gxx-name=/apps1/gcc-4.5.0/bin/g++ -shared -o lib/libMyCustom.so -Llib -L/apps1/boost-1.48.0/lib -Wl,-rpath=/apps1/boost-1.48.0/lib -L/apps1/gdal-1.8.0-jasper/lib -Wl,-rpath=/apps1/gdal-1.8.0-jasper/lib -L/new_apps1/hdf4/lib -Wl,-rpath=/new_apps1/hdf4/lib -L/new_apps1/netcdf/lib -Wl,-rpath=/new_apps1/netcdf/lib -lboost_system -lboost_serialization -lboost_date_time -lboost_thread

How to work (portably) with C++ class hierarchies & dynamic linked libraries

隐身守侯 提交于 2019-12-04 07:30:13
Ok, so I know portability is not the strong point of C++, but I have to get my code running on both Mac&Windows. I've come up with a solution, but it's not perfect, and I'm interested to see if there is someone out there who can suggest a better one. I need to us a class hierarchy in several DLLs/bundles - e.g., I have an abstract base class BaseClass; and I scan a given directory for DLLs, and for each DLL, I look for the factory method BaseClass* CreateObject(); - which returns a "BaseClass". I have a "shared header file" that I include both in the "main executable" & in the DLLs, that

Unable to load .so library files when making a system application

↘锁芯ラ 提交于 2019-12-04 07:10:20
I have created an application which will be a System Application . When I install the application normally(not as system application) ".so" files are getting loaded. But when I'm making it a system application by putting the apk into /system/app/ , I'm getting the following error 01-09 00:20:26.889: E/AndroidRuntime(2101): java.lang.UnsatisfiedLinkError: Couldn't load iconv from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/system/app/My.apk"],nativeLibraryDirectories= [/vendor/lib, /system/lib]]]: findLibrary returned