shared-libraries

GNU ld cannot find library which is there

The packages I'm toying with here are rather unknown, but nevertheless the problem is rather generic. Basically, I'm trying to compile Python module (called rql) with C++ extension. The extension uses external framework called gecode, which contains several libraries. I compiled gecode and installed locally. Now, let the output speak for...

Modifying Shared Libraries in Linux

Is it possible to modify a shared library (.so) in Linux without getting its source code??? I know about LD_PRELOAD, but is that useful for functions that are used IN the shared library itself??? Is there a way to decompile/disassemble and then recompile/reassemble binary ELF files? ...

How can my .so find its dependent .so in different Ubuntu version?

Hi Everyone? I have one libA.so. It is used by JNI method. And I have two different version of Ubuntu. One is Ubuntu 8.04 and the other is Ubuntu 9.10. libA.so has a dependency. libA.so depends on libB.so and libB.so depends on libC.so. ie. libA.so -> libB.so -> libC.so (Actually libB.so and libC.so are related with GTK) The li...

How do you create, compile and use static and dynamic libraries in linux-like systems?

Hello, this is my main question: How do you create, compile and use static and dynamic libraries in linux-like systems? What is the difference between them? Are there any good free tutorials explaining this stuff for a total idiota like me. I've only done c# programming before. I know a little C, C++ and Objective-C. I'm developing fo...

Simplest way to compile an autotools based shared C library for Android?

I have a cross-platform C library that I need to compile for Android as a *.so file. The library consist of many .c and .h files, and it use autotools as it's buid system. (./configure && make dep && make). Afaik, the library does not depend on other libraries, other than libc and OpenSSL (which should be present on Andriod). I'm tryin...

LD_PRELOAD affects new child even after unsetenv("LD_PRELOAD")

my code is as follows: preload.c, with the following content: #include <stdio.h> #include <stdlib.h> int __attribute__((constructor)) main_init(void) { printf("Unsetting LD_PRELOAD: %x\n",unsetenv("LD_PRELOAD")); FILE *fp = popen("ls", "r"); pclose(fp); } then in the shell (do the 2nd command with care!!): gcc prel...

so file does not work sometimes

Hi Everyone? My Question is not resolved. A.so depends on B.so. B.so depends on C.so. The method in A.so is called many times in my application. On Ubuntu 9.10, the method works properly. But on Ubuntu 8.04, the method does not work properly. Sometimes it works. Sometimes it does not work. I don't know why... I checked A.so using ...

Is there any way in C/C++ to detect if code is running during static initialization?

I'm writing a tracing library that is available as a DLL. It is consumed by basically every component in my system. One tricky requirement is that the tracing functions need to be invoked very early in the process lifetime, even before main() runs. Consumers of this library include executables, statically linked DLLs, delay-loaded DLL...

Java equivalent of .NET's System.Xml.Schema classes?

The .NET Framework exposes a rather useful set of classes as part of the System.Xml.Schema namespace. Among other things, classes such as XmlSchema and XmlSchemaElement provide a useful API for defining/writing and parsing/reading/traversing XML schema files. Does an equivalent library exist for Java? ...

how can shared library get its own base address

I have the offset address's of all symbols (obtained with libelf executing on its own binary .so). Now, at runtime, I would need to calculate the absolutue address's of all those symbols and for that I would need to get the base address (where the shared library is loaded) and do a calculation: symbol_address = base_address + symbol_off...

JBoss Custom lib directory

I have this third party framework which comes with a huge set of dependent libraries, which by the way, have not yet been indexed in any Maven repository. I want to use this framework with some Web Apps, but for obvious reasons I don't want to put all those libraries under WEB-INF/lib, neither do I want just to place them all under serve...

Linux: How to embed version information into shared library and binary?

On Linux, is there a way to embed version information into an ELF binary? I would like to embed this info at compile time so it can then be extract it using a script later. A hackish way would be to plant something that can be extracted using the strings command. Is there a more conventional method, similar to how Visual Studio plant ver...

Can't find libavcodec when running ./configure for vlc

Hi, I am trying to run './configure' for vlc on ubuntu 10.04. But it can't find libavcode libraries for some reason. I have check /usr/lib, it has the libraries, why ./configure can't find it? This is the error from './configure': checking for AVCODEC... no configure: error: Could not find libavcodec or libavutil. Use --disable-avcod...

Determining version of zend framework installed on server

Hi, Is there a way to determe what version of zend framework is installed on a server/included in the app? The reason I'm asking is that I'm on a shared host and I would like to use a different version than that supplied by the host and I would like to be certain that the version I'm supplying is the one being utilized by my website. ...

dlopen with two shared libraries, exporting symbols

I have a linux shared library, foo.so, which is loaded from an executable using dlopen("foo.so", RTLD_NOW | RTLD_LOCAL). From foo.so I'd like to dlopen another library, bar.so, which references symbols defined in foo.so, but the linker fails to find them. I can't change RTLD_LOCAL to RTLD_GLOBAL, because I don't have the source to the ex...

How do I diagnose why a .so file won't load when executing a .mex file in MATLAB?

I'm trying to use a video library called VideoIO with MATLAB for a machine learning project. When I try to invoke the library in MATLAB, I get an error saying that it can't find libavutil.so.50, one of the ffmpeg libraries that VideoIO depends on. I've checked a few different things but can't find anything that looks wrong, other than th...

how can i use a shared lib in glassfish to avoid deployment of the huge libs?

I have to upload about 30M for my app since it uses a lot of libraries, log, web engine and so on. I think there should be a way to share these libs on glassfish, but I failed to figure it out. I tried to put them in domain/lib/ext but does not work. So where should I store these libs and how should I refer to them? thank you. ...

How to link a specific version of a shared library in makefile without using LD_LIBRARY_PATH?

Hi experts, I know that LD_LIBRARY_PATH is evil and it's a good habit to avoid using it. I have a program called server.c on a remote Solaris 9 server that holds two versions of openssl library (0.9.8 and 1.0.0) and I'm using gcc 3.4.6. My program need to link to 1.0.0a version. Because it's work environment, I don't have the right to m...

Tracing linked libraries

I'm getting some errors which make me think that my Linux program isn't linking to the libraries it's supposed to. How can I get the full path to all linked libraries? I know ldd will give me the names, but how can I use that to get the full path? Thanks. ...

On Linux, why does the destructor run twice on shared instance of global variable in C++?

On Linux I have some generated C++ code from a static library that defines a global variable. A single instance of this global variable is shared between two shared libraries that refer to its symbol. When the process shuts down and the static termination phase is run, I see that the destructor on this shared instance is run twice! Pr...