shared-libraries

Program use two conflicting shared libraries

假装没事ソ 提交于 2019-12-12 02:26:15
问题 I have a shared library A.so . There is a function foo() defined in it. This foo() function depends on a shared library libnl-1.so . The relationship is below: A.so { foo() => libnl-1 } I have a program app . It calls two functions, foo() and bar() . bar() needs another version of libnl, libnl-3. The relationship is below: app { foo() bar() => libnl-3 } I compiled app using cc -o app -lnl-3 -lA . But I found my app always crashes. It seems that foo() is calling into libnl-3 instead of libnl-1

How to include third party library when programming Lua script in Redis

佐手、 提交于 2019-12-12 02:25:17
问题 I'm using Redis script by Lua to do some module related to money (http://redis.io/commands/eval). Unfortunately, Redis Lua does not support big decimal type. I searched through the internet and found some library for supporting decimal for lua like lmapm. But unfortunately, I don't know how to install to use it in Redis script. For a general question, how can I install third party library for Redis script (like https://github.com/amakawa/ohm.lua), because seem like Redis script does not

The hidden visibility does get applied in my shared libraries but works for static libraries on linux

ⅰ亾dé卋堺 提交于 2019-12-12 02:23:02
问题 I went through this post Hiding symbol names in library but still could not get proper conclusion 1) Filename : lib_mylib.h int fun(); int fun1(void); int fun2(void); 2) Filename: lib_mylib.c */ #include <stdio.h> int fun() { return 2; } int fun1(void) { return 2; } int fun2(void) { return 2; } 3) File :my_lib_shared.c #include "my_lib.h" int foo(void) { return fun() + 4; } 4) File: my_lib_shared.h int foo(); 5) File driver.c /* filename: driver.c */ #include "my_lib.h" #include "my_lib

undefined reference when using local header file

為{幸葍}努か 提交于 2019-12-12 01:58:46
问题 I encountered an undefined reference error when working with automake, which only occurs when a certain local header file ( include/lmp2atomstyle.h , which is required by a library within the same repository) exists in the repository. I was working on combining multiple automake project source folders, lmpio and lmp2atomstyle , into a single one for convenience. Both projects are libraries which also provide a small program each for testing. After manually merging Makefile.am , lmp2atomstyle

Implementing pipe using shared memory

三世轮回 提交于 2019-12-12 01:43:33
问题 I'm implementing a pipe using shared memory. I should write and touch only the library, and not the main() . I encountered a problem: Lets say this is the main() of some user who uses my library shared_memory_pipe.h : #include "shared_memory_pipe.h" int main() { int fd[2]; shared_memory_pipe(fd); if (fork()) { while(1) {} } shared_memory_close(fd[0]); shared_memory_close(fd[1]); } In this example we see that child closes both of his fd's, but the father is stuck on an infinite loop, and never

namespace or packages in c modules

风流意气都作罢 提交于 2019-12-12 01:36:40
问题 I'm a beginner level c programmer coming from high level languages and feeling like c is of a flat structure. Is there a sort of way to simulate packages so I can have a clean namespace without requiring prefixes. Nested structures is one what I'm looking at. How it works with 3rd party external libraries out there, what happens when there's a name conflict or is it sort of separate. In case I've to build a library or a multi modular application linked with libs so each module can have a

Ensuring internal shared library versions are correct

拜拜、爱过 提交于 2019-12-12 01:32:14
问题 I'm currently tasked with trying to improve our companies versioning practices when it comes to our internal libraries. I've read about Semantic Versioning 2.0.0 and this seems like a really nice, simple and elegant solution to our current problem where our current versioning practices (e.g. library_v01) don't really tell us much about each library version. Ideally the applications would check the version of the library being used at compile time as to catch any mismatches before a deployment

UnsatisfiedLinkError: Native method not found with .so file correctly put in Eclipse libs

最后都变了- 提交于 2019-12-12 00:34:52
问题 I'm new in using native methods for Android. I got the errors as below even after I have make sure my armeabi, armeabi-v7a, mips and x86 with correct *.so file are put correctly in the folders. 10-21 18:51:36.685: E/AndroidRuntime(24277): java.lang.UnsatisfiedLinkError: Native method not found: com.arzap.mimas.MimasJNI.MIMAS_LoadModel:(Ljava/lang/String;)V 10-21 18:51:36.685: E/AndroidRuntime(24277): at com.arzap.mimas.MimasJNI.MIMAS_LoadModel(Native Method) 10-21 18:51:36.685: E

I need to list the programs which have a specified shared library linked to them in UNIX/Linux (like ldd but vice versa)

陌路散爱 提交于 2019-12-12 00:21:52
问题 ldd command in unix/linux lists all the dinamically linked libraries of a program. how can I determine the reverse question: what is the list of programs linked to a specified shared library? I need a way of getting a list of programs that use "libz" for instance. is there a command for that? 回答1: I highly doubt there would be. That would require keeping a database of all executables and remembering what they depend on, which may be possible if you only install software from a specific

loading library (.so file) in android [duplicate]

泄露秘密 提交于 2019-12-11 22:55:06
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Creating a product SDK: How do I add a native lib (.SO) and a jar with the SDK I am creating? I'm trying to use com.android.SystemClock in an app, which calls a native method. I need to load the library that this native method belongs to (i.e. System.loadLibrary(...)). The method is defined in the file: frameworks/base/core/jni/android_os_SystemClock.cpp. How do I figure out which library this belongs to and