shared-libraries

LD_LIBRARY_PATH ignored on Android sometimes

纵然是瞬间 提交于 2019-12-21 02:56:10
问题 i have an android app which spawns many native executables dinamically linked with libraries i distribute with the package. To launch those binaries, i use the LD_LIBRARY_PATH environment variable to make them aware of the place to load the libraries from, but on some devices this doesn't work at all, the LD_LIBRARY_PATH is correctly updated but the binary fails to find the library anyway. This is not something i can reproduce because on my two devices ( Galaxy Nexus & Nexus 7 with stock roms

understanding shared libraries using gcc

左心房为你撑大大i 提交于 2019-12-21 02:45:11
问题 I am trying to understand the following behavior of shared libraries in C Machine One $ cat one.c #include<stdio.h> int main() { printf ("%d", 45); } $ gcc one.c -o one -O3 $ ldd one linux-gate.so.1 => (0x00331000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00bc2000) /lib/ld-linux.so.2 (0x006dc000) $ cat two.c int main() { int i = 0; } $ gcc two.c -o two -O3 $ ldd two linux-gate.so.1 => (0x006f7000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00110000) /lib/ld-linux.so.2 (0x00eb0000) $

Theme/style Angular 2 reusable component libraries

狂风中的少年 提交于 2019-12-21 02:36:23
问题 General problem I want to style reusable Angular components to match the style of the specific client project. I maintain the reusable components in a separate project and generate an npm package out of it. That package is published to a private NPM repository (Sinopia) and then installed into multiple client projects. The general styling is - of course - specific to the component, but color and font - for example - should match the client project. How can I best apply styles such as color

how to link shared library against other shared library in linux?

你。 提交于 2019-12-21 02:25:06
问题 My application dynamically loads liba.so (with dlopen ). liba.so uses libb.so so I want to link liba.so against libb.so . How to do this in Linux? Thanks in advance. 回答1: If you build liba.so yourself, you need to link it with -l option gcc -o liba.so liba.o -L/libb/path -lb If you don't have liba sources, perhaps you could create libawrapper.so linked against liba and libb and to load dynamically this library gcc -o libawrap.so -L/liba/ -L/libb/ -la -lb 来源: https://stackoverflow.com

Making a shared library from existing object files

爱⌒轻易说出口 提交于 2019-12-21 01:11:13
问题 I have a project in my IDE. I need to make a shared library of it to use in extensions. I don't want to make a copy of this project with shared-library settings. Is there any way to build a shared library using the object files (.o) from my already existing project? As I understand, I can write a makefile for this. 回答1: I assume you're on some sort of Unix and are probably using the GNU toolchain. In that case, to create a proper shared library, you'd need to compile your code using the

Storing function pointer in std::function

馋奶兔 提交于 2019-12-20 20:05:00
问题 I'm trying to write a C++0x wrapper around dlopen()/dlsym() to dynamically load functions from shared objects: class DynamicLoader { public: DynamicLoader(std::string const& filename); template<class Signature> std::function<Signature> load(std::string const& functionName); private: void *itsLibraryHandle; }; DynamicLoader::DynamicLoader(std::string const& filename) { itsLibraryHandle = dlopen(filename.c_str(), RTLD_LAZY); if(!itsLibraryHandle) { /* Throw Some Error */ } } template<class

Storing function pointer in std::function

只愿长相守 提交于 2019-12-20 20:04:23
问题 I'm trying to write a C++0x wrapper around dlopen()/dlsym() to dynamically load functions from shared objects: class DynamicLoader { public: DynamicLoader(std::string const& filename); template<class Signature> std::function<Signature> load(std::string const& functionName); private: void *itsLibraryHandle; }; DynamicLoader::DynamicLoader(std::string const& filename) { itsLibraryHandle = dlopen(filename.c_str(), RTLD_LAZY); if(!itsLibraryHandle) { /* Throw Some Error */ } } template<class

Breakpoints don't work while debugging native Android library in Visual Studio 2015

只谈情不闲聊 提交于 2019-12-20 19:04:47
问题 On a fresh installation of Visual Studio 2015 I created an Android application and Android native library. Functions from native library are referenced in the app code through DllImport directives. When I select "Xamarin debugger" for main app and start debugging, I am able to stop on breakpoints in C# code, but debugger doesn't step into native function calls. When I select "Microsoft debugger" breakpoints don't work at all. During debugging session all breakpoints are marked as disabled and

What is the best way to make shared libraries available to multiple applications?

断了今生、忘了曾经 提交于 2019-12-20 14:14:55
问题 Like most shops we've got a team of people working on various projects that all need to access the same core information and functions that relate to our business, usually in C#. We're currently just copying common classes from project to project, but everyone is starting to have their own flavors and we want to consolidate. We use Tortoise SVN and have decided to maintain a separate project to contain our common classes, but are not sure the best way to deploy this common code to our various

Shared library in Fortran, minimal example does not work

拈花ヽ惹草 提交于 2019-12-20 10:44:08
问题 I am trying to understand how to dynamically create and link a shared library in Fortran under Linux. I have two files: The first one, liblol.f90 , looks like this: subroutine func() print*, 'lol!' end subroutine func I compile it with gfortran -shared -fPIC -o liblol.so liblol.f90 The second file, main.f90 , looks like this: program main call func() end program main When I now try to compile that with the command gfortran -L. -llol main.f90 -o main , I get the following error: /tmp/ccIUIhcE