shared-libraries

Linking Errors While creating a shared library

Hello, I currently have some C++ code that I want to compile into a shared library that I can dynamically link to a Java application during runtime using the Java Native Interface (JNI). The problem that I'm facing is - the C++ code that I'm trying to compile calls on another library itself, making use of a lot of classes and different h...

Undefined reference problem when dynamic library is used

I was reading about static and dynamic libraries. To explore more I created three files 2 .cpp files and 1 .h file demo.h class demo { int a; public: demo(); demo(const demo&); demo& operator=(const demo&); ~demo(); }; demo.cpp #include "demo.h" #include <iostream> demo::demo():a() { std::cout<<"\nInsi...

How to optionally depend on a shared object with gcc?

First, I don't know if there is a solution to my problem at all. I have the following situation: I have developed a framework library that depends on several other libraries for specific hardware access, etc. Until now this framework library was only statically linked against. For the executable that uses the framework library only th...

Link my shared library to another (CMAKE)

Hello, I'm currently trying to link a CXX library that I've written to a VTK, a CMake made library - to end up creating a shared library that has my code's functionality and can resolve the symbols from VTK. I need the end result to be shared because I'd need to call the library up at runtime in Java. Please feel free to ask any quest...

Can TFS Projects Reference Each Other?

I've recently begun working in an enterprise software environment with hundreds of different applications all confined to their own "silos." One of my tasks is to try to standardize things a bit, and the first attempt will be a standard event logging. Currently, the company's "standard" is "everyone should use Enterprise Library for lo...

Valgrind losing symbol info

After running Valgrind, the resultant log file contains a number of errors that look like Conditional jump or move depends on uninitialised value(s) at 0x3D9863AA: ??? by 0x3D986287: ??? by 0x3D9854AC: ??? Uninitialised value was created by a heap allocation at 0x7FCC050: operator new(unsigned int) (vg_replace_malloc.c:214) by...

object file from .a not included in .so

Hi, I have created a .c file which is being converted to a .o file along with around 300 other .c files and included in a .a static library. This library, along with many others is being used to create a .so dynamic library. On analyzing both the .a and the .so file with nm, I found that for some reason the symbols defined in the .c fil...

How to use Linked Libraries when the build folders are different.

I have an XCode project consisting of three targets. A Cocoa application, and two shared libraries (as .dylibs). The one .dylib file implements some core framework functionality and goes into the same directory as the .app The other .dylib is a plugin, and goes into a Plugins folder. So I have setup the Per-configuration build Products ...

Analyzing core file of shared object

Tests : [1] creating divide of 0 in executable hat was compiled with optimization (O2) and debugging symbols , thus a core was generated. [2] creating divide of 0 in shared object hat was compiled with optimization (O2) and debugging symbols , thus a core was generated. Results: [First] analysing the core generated by [1] was succeed...

GDB and shared object libraries with SIGILL

I am trying to debug programs on an ARM target device with GDB and GDB seems to be acting odd with regards to ld-linux.so.3. It's a simple program that just printf("Hello World"). Approximately half the time, gdb it will run and the other half jump to this error after typing run: Program received signal SIGILL, Illegal instruction. 0x2...

When Linking: use -l flag or just treat archives as input

I had some problems linking the static library stxxl into a shared library as outlined in my question Linking a static library into Boost Python (shared library) - Import Error The command I was using was g++ -Wall -pthread -march=i686 -I/home/zenna/Downloads/stxxl-1.3.0/include -include stxxl/bits/defines.h -D_FILE_OFFSET_BITS=64 -D_L...

gcc, c++: static string member variarible causes heap corruption/segmentation fault

I have a big application that uses the dynamically loaded libraries. At the end of program while terminating it either segfaults or spits a message "glibc detected corrupted double-linked list". Looking at the valgrind output I think this is what the case is: let say we have three files: utilities.c - compiled with -fPIC and used...

How to build a dylib from several .o in Mac OS X using gcc

I have several .o files and want to bundle them in a .dylib, how can I do that it Mac OS X using gcc? Thank you very much. ...

Is it good to link a shared library against other shared libraries?

I have an application X which uses shared libraries A,B and C. Shared library C also uses some symbols from Shared library A. Application X is linked against A and B during compile time and it does dlopen to load C at run time. My question is Is it a good idea to link C against A during link time or leave the symbol resolution for run...

Determine which executables link to a specific shared library on Linux

How can I list all executables on my Red Hat Linux system which link to libssl? I can get close with: find / -type f -perm /a+x -exec ldd {} \; | grep libssl ldd shows me which libraries the executable links with, but the line that contains the library name does not also show the filename, so although I get a lot of matches with g...

What's the simplest way to write portable dynamically loadable libraries in C++?

I'm working on a project which has multiple similar code paths which I'd like to separate from the main project into plugins. The project must remain cross-platform compatible, and all of the dynamic library loading APIs I've looked into are platform specific. What's the simplest way to create a dynamic library loading system which can ...

incorporate .so into another .so without dependency?

i have a c program that relies on a second library whose compilation i can control. i want to be able to compile my program into a shared object library without it linking to the second library. in other words i want a single monolithic shared object library at the end. how can i do this? if i separately compile the second library into ...

copying application to another machine, cannot find shared library

Hello gcc 4.4.3 c89 linux I am using log4c and have placed the inc and lib in the following directories /home/jeff/projects/gateway/tools/log4c/inc /home/jeff/projects/gateway/tools/log4c/lib In my Makefile I have specified the inc and lib path: INC_PATH = -I tools/log4c/inc LIB_PATH = -L tools/log4c/lib LIBS = -llog4c In my lib ...

Using reference libraries (dll) stored in a different folder from the main program?

(This might be a obvious question but I wasn't sure what to ask Bing/Google) In a VS2008 (C# Winforms) project there are numerous third party libraries that are referenced. The project uses 'Copy Local = True' so that the various DLL files end up in the same folder as the compiled application. To clean things up I would like to modi...

How do I handle symbolics links in projects under source control?

We have several php projects. The projects use the Zend Framework and we also maintain a common core library with various functions. Right now my directory structure looks like this project-1 \application \model \views \controllers \libraray \...