shared-libraries

Wrapping different versions of static library in dynamic libraries

In my project there is a dependency on a static library (just called libsomething from now on) from a 3rd party. Recently, libsomething has become available in another version. My task is to provide my software with support for the old and the new version. Only one version of libsomething is used at run-time at any given time, but which ...

Compile a shared library statically

I've got a shared library with some homemade functions, which I compile into my other programs, but I have to link the end program with all the libraries I have used to compile the static library. Here is an example: I have function foo in the library which requires a function from another library libbar.so. In my main program to use f...

How to make the debugged app find shared libraries when invoked in gdb inside Eclipse CDT?

I'm trying to debug Firefox trunk inside Eclipse CDT on Linux x86_64 (Ubuntu Karmic). I have done the following: I have made a path mapping from / to / per DevMo in the Source pane of the project-level Run/Debug config. I have set /opt/Projects/obj-debug/dist/bin/firefox-bin as the C++ app in the Main pane. (My Firefox obj dir is /opt...

Build a .so using ffmpeg

Hi! I'm currently coding a small API to project thing onto a dome. To play video i use ffmpeg inside my display class (the core of the API). When i compile a project ( I'm using kdevelop) with the .cpp and .h containing my class, the project work perfectly. But i would like to made my class a .so for easy sharing and use. I compile e...

Is there a .def file equivalent on Linux for controlling exported function names in a shared library?

I am building a shared library on Ubuntu 9.10. I want to export only a subset of my functions from the library. On the Windows platform, this would be done using a module definition (.def) file which would contain a list of the external and internal names of the functions exported from the library. I have the following questions: How ...

Developing for mobile devices and desktop

Hi, I'm starting a new project. It will run on devices running Windows CE, Windows Mobile 6 and will also have a desktop version. The software will connect to some equipments through the serial port, using it's own protocol. Basically it will: connect to the equipment send and receive info read and write binary files These tasks wil...

What is the easiest way to reference libraries in Qt projects?

I have two Qt4 Gui Application projects and one shared library project, all referenced under a .pro file with the "subdirs" template. So, it's like: exampleapp.pro app1.pro app2.pro sharedlib.pro Now, what I want to do is reference sharedlib from app1 and app2 so that every time I run app1.exe, I don't have to manually copy sharedl...

How can I compile an autotools project with statically linked dependancies?

There's an open source library I want to use. As I want to spread my software as binary package, I do not want the library to have dependancies on other libraries, so I need to link the dependancies statically. Now as the library is open source and there are no binaries provided, I compile it myself. The library uses autotools, and I di...

Locale C++ shared library in /usr/local/lib

I'm venturing into the world of C++ and Linux, and am having problems linking against a shared library. I have a library, libicuuc.so.44.1, installed in /usr/local/lib. There is also a link in the same directory, libicuuc.so.44 pointing to that library. My /etc/ld.so.conf reads: include /etc/ld.so.conf.d/*.conf I have a file, /etc/l...

How do I share usercontrols/functionality between sites?

Hi We have two asp.net sites (based on episerver). Using Telerik Asp.net controls. We have some funtionality that we want to have availible in both sites. Right now one of the sites use webparts/usercontrols and the other uses usercontrols. Is there any way to share the functionality between these sites? What I would like is to be abl...

Does changing the order of class private data members breaks ABI

I have a class with number of private data members (some of them static), accessed by virtual and non-virtual member functions. There's no inline functions and no friend classes. class A { int number; string str; static const int static_const_number; bool b; public: A(); virtual ~A(); public: // got virtual a...

Is profile guided optimization possible with shared libraries in gcc?

Hi, I recently rolled out a new Toolchain on Linux, with gcc 4.5.0 and binutils 2.20 with gold. Now I was curious about this new thing PGO. While it's clear how it works with executables, I've not been able to find an answer on shared libraries. I found two unanswered posts on the gcc mailing list via google, that's all. So here's what...

How would I instruct extconf.rb to use additional g++ optimization flags, and which are advisable?

I'm using Rice to write a C++ extension for a Ruby gem. The extension is in the form of a shared object (.so) file. This requires 'mkmf-rice' instead of 'mkmf', but the two (AFAIK) are pretty similar. By default, the compiler uses the flags -g -O2. Personally, I find this kind of silly, since it's hard to debug with any optimization en...

Class Library public functions are not accessible in another class library as console application

Hello, I have one class library that have all functions declared as public under public class. Still When I am going to call one of those it gives linker errors. Do I need to export these methods explicitly from class library as we export from native dll. When I export with __declspec(dllexport) it says that function cannot be exported ...

How to load a library that depends on another library, all from a jar file

I would like to ship my application as a self-contained jar file. The jar file should contain all the class files, as well as two shared libraries. One of these shared libraries is written for the JNI and is essentially an indirection to the other one (which is 100% C). I have first tried running my jar file without the libraries, but h...

CMake cyclic dependency error when custom library name is the same of a system library

Hi guys, i have the following problem. I'm writing a CMakeLists.txt to build a C++ project of mine, which is composed of libhybris.so : A shared library with some exported functions. hybris : An executable which links to libhybris.so A set of various shared libraries which links to libhybris.so The problem is that, libhybris.so depen...

How to get shared library names like ``libhello.so.0.0.1'' with scons?

I'm using the scons utility to generate shared libraries. When I write the following rule: SharedLibrary('hello', 'hello.c') I would get the ``libhello.so'' file. Is there a way to get files like ``libhello.so.version'' automatically? ...

Dynamic loaded libraries and shared global symbols

Since I observed some strange behavior of global variables in my dynamically loaded libraries, I wrote the following test. At first we need a statically linked library: The header test.hpp #ifndef __BASE_HPP #define __BASE_HPP #include <iostream> class test { private: int value; public: test(int value) : value(value) { std::...

Shipping GNU/Linux Firefox plugin with shared libraries (for installation with no root access)

The application is a Firefox plugin (loaded from $HOME/.mozilla/plugins), so wrapper script that sets LD_LIBRARY_PATH is not an easy option. RPATH, as far as I know, cannot refer to $HOME and can be only absolue path. Firefox tries to dlopen it's plugin from ~/.mozilla/plugins but fails (because it depends on shared libraries installed...

How to add a dynamic library to Android?

I want to add a non-native shared library to Android so every application on the device would be able to use it. I mean using packaged classes just like a core library as if they were present in the application itself. I studied Android source code to figure out a way to add a new path to the application ClassLoader and found out that i...