shared-libraries

How to hook a function for a particular shared ELF library?

LD_PRELOAD hooks some functions for the entire process, but I need to hook a particular function for only one dynamically linked library by its name. ...

In Linux, how can I completely disregard the contents of /etc/ld.so.cache?

Hi, For the purposes of prototyping a new set of shared libraries in a development sandbox (to which I don't have root access), I'd like to know how to execute a binary while completely overriding the contents of /etc/ld.so.cache, so that none of the system libraries get loaded. How can this be done? I have looked at mechanisms like se...

Change library load order at run time (like LD_PRELOAD but during execution)

How do I change the library a function loads from during run time? For example, say I want to replace the standard printf function with something new, I can write my own version and compile it into a shared library, then put "LD_PRELOAD=/my/library.so" in the environment before running my executable. But let's say that instead, I want ...

NetBeans6.9 C++ runtime error

In NetBeans 6.9 in windows version I use CygWin for C++ programming.I can compile my simple program and BUILD SUCCESSFUL message show by output window in NetBeans but when run my project this message show in external terminal : /cygdrive/c/Users/SjB/Documents/NetBeansProjects/CppApplication_3/dist/Debug/Cyg win-Windows/cppapplication_3....

Difference between libcurl and libsoup

What are the advantages and disadvantaghes of using libcurl and libsoup? Which one is better to use for a HTTP operation where I have to send request to a server to get a response, and has a quick reaction time? TIA, Praveen ...

Segmentation fault while embedding python in ubuntu

I have an application where I'm embedding python. It was developed on windows where it works fine, but now I'm porting it to linux with less success where it crashes in Py_Initialize(). From gdb, it seems to happen when loading the os module. gdb reports this callstack on seg fault: #0 0x002384fc in import_submodule (mod=None, subname...

Hot-pluggable C++ library possible?

I'm looking to "hot plug" a library of C++ code. I'm interested in having this technique work cross platform between Linux/Mac/Windows. Basically I want to have the main program #include "StateMachine.h" which defines all callable interfaces. Then at runtime and DURING EXECUTION load and unload StateMachineLibrary.a to have my applica...

Force linker to export a resolved symbol when creating shared library

I am creating a shared library using c++ -shared (which is gcc running on x86_64). I can't manage to strip my problem down to a minimal test case, but the issue I'm having is that I am creating a .so out of a bunch of .o files. One of those .o files exports a symbol (nm shows 'D') that I want exported from the .so. Others of the .o's req...

dbi::Oracle error while running from cron

Hi I am using DBD::Oracle in my script to query into oracle database. When I am running this script its working fine but when i schedule to run this from cron its giving below error install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libnnz1...

Compiling apache modules for Windows and Linux distros

Hello everyone. I have written an Apache2 module in C, now I am at the point of distributing the module. I am not sure of the standard practices regarding the distribution of Apache modules, so I am considering to provide binaries for some of the more common platforms, like Windows and Ubuntu, etc. I have two questions to ask- Will ...

gcc linker error: version node not found for symbol ...

Hi, I'm trying to build a shared library, and I get the following error: libavformat.so: version node not found for symbol av_dup_packet@LIBAVFORMAT_52 ld: failed to set dynamic section sizes: Bad value Does anybody knows what this error means? Host is i586-linux target is arm-linux Edit: Resolved, see comments ...

address space Library or Process

Hi, I have one basic doubt. I have a process which uses a shared library. If I am allocating some memory in the library then which address space it is. (Library or Process) In my opinion it is the process address space because once the library is attached it is all in process address space. Please correct me if I am wrong. Thanks Arpi...

How to call Matlab form C++ code?

I am trying to call Matlab functions form C++ code. With Matlab it comes an example of such code at /extern/examples/eng_mat/engdemo.cpp, however I found no way to build that source code. Here is the makefile I use: CFLAGS = -Wall -O3 INCLUDES = -I/opt/Matlab-2009a/extern/include LIBRARIES = -Wl,-R/opt/Matlab-2009a/bin/glnx86 -L/opt...

Using Autotools for a new shared library

What I want to do is to create a new shared library called libxxx that links against another shared library called libzzz, this shared library has an independent "pkg-config"-like tool, let's say it's called "zzz-config" which gives the cflags needed by the compilation phase when using the libzzz. What I want to do is: Create configure...

Change SONAME of an existing shared library?

Is it possible to change SONAME of a shared library without rebuilding it? I've found hints pointing out that it's hard, but it does not say it's outright impossible. ...

Shared Library file format not recognised

Hi, I am using a shared library. Which I am using it to cross compile my executable. During the linking stage linker throws the error file format not recognised. When I run ld on it libcclass.so: file not recognized: File format not recognized When I run file libcclass.so: it gives libcclass.so: ELF 64-bit LSB shared object, x86-64, v...

Porting a C/C++ program into Android

I am attempting to put my C++ program onto an Android phone but have run into several problems with the library linking. It seems most of the useful information I find on this topic through google is outdated (motz) or simply does not account for the complexity of my program. I have been able to run simple C programs but fail when attemp...

How to check Shared Library exposed functions in program

Hi, I am using a third party shared library and I need to check whether a function is exported by shared library programatically. How to do this. I need this because if function does not exist I need to run some other function locally. ...

How to use ldconfig to add pthread library

Currently, while compiling a C program which uses pthread library function I have to specify compiler option -lpthread explicitly. Please suggest a way to configure ldconfig so that the pthread library could be used without specifying it on the command line. presently lpthread -p gives the following output := [root@localhost lib]# ldco...

C++: How to link a library, located in my project folder?

Hi, I'm using Linux and Eclipse. I want to use a library (Box2D). I have the lib-file "libBox2D.so.2.1.0". I put it in a self-made lib folder in my project folder (also the working directory for the executable). I added -lBox2D to the linker command-line arguments. (This means I added "Box2D" as library in the Eclipse GUI). But when I ...