Questions tagged [shared-libraries]

Shared libraries are libraries that are loaded by programs when they start. A single shared copy of each library is loaded into physical memory and may be used by multiple processes at the same time. This reduces memory use and improves system performance. This tag should never be used alone.

7905 questions
26
votes
5 answers

Change current process environment's LD_LIBRARY_PATH

Is it possible to change environment variables of current process? More specifically in a python script I want to change LD_LIBRARY_PATH so that on import of a module 'x' which depends on some xyz.so, xyz.so is taken from my given path in…
Anurag Uniyal
  • 85,954
  • 40
  • 175
  • 219
26
votes
1 answer

Python ImportError - undefined symbol - for custom C++ module

I've been developing a Python module in C++ using OpenCV 2.3 through 2.4.2, on Ubuntu 11.04. OpenCV was built from source. I'm not using the version of OpenCV from the Ubuntu repositories. My Python module compiles with no issues and is loaded in…
Rajesh J Advani
  • 5,585
  • 2
  • 23
  • 35
25
votes
3 answers

How to force symbols from a static library to be included in a shared library build?

I'm trying to build a shared object library that will be opened by a program using dlopen(). This library will use functionality provided by a separate library that is static. I have included the appropriate flag on the link line to pull in the…
BD at Rivenhill
  • 12,395
  • 10
  • 46
  • 49
25
votes
3 answers

Why is fPIC absolutely necessary on 64 and not on 32bit platforms?

I recently received a: ...relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC error while trying to compile a program as a shared library. Now the solution to this is not too difficult…
Bojan B
  • 393
  • 3
  • 9
25
votes
3 answers

Are inline variables unique across boundaries?

This is a follow up of this question. As mentioned in the comments to the answer: An inline variable has the property that - It has the same address in every translation unit. [...] Usually you achieved that by defining the variable in a cpp file,…
skypjack
  • 49,335
  • 19
  • 95
  • 187
25
votes
5 answers

How do I find out which functions of a shared object are used by a program or an other library?

How do I find out which functions of a shared object are used by a program or an other library? In this specific case, I would like to see which functions in /lib/libgcc1_s.so.1 are used by an other dynamic library. Since they are dynamically…
lultimouomo
  • 251
  • 1
  • 3
  • 3
25
votes
5 answers

g++: In what order should static and dynamic libraries be linked?

Let's say we got a main executable called "my_app" and it uses several other libraries: 3 libraries are linked statically, and other 3 are linked dynamically. In which order should they be linked against "my_app"? But in which order should these be…
25
votes
1 answer

C++ shared library undefined reference to `FooClass::SayHello()'

I'm making a C++ Shared Library and when I compile a main exe that uses the library the compiler gives me: main.cpp:(.text+0x21): undefined reference to `FooClass::SayHello()' collect2: ld returned 1 exit status Library code: fooclass.h #ifndef…
fivunlm
  • 462
  • 1
  • 6
  • 15
24
votes
3 answers

What's the accepted method for deploying a linux application that relies on shared libraries?

I have an application that relies on Qt, GDCM, and VTK, with the main build environment being Qt. All of these libraries are cross-platform and compile on Windows, Mac, and Linux. I need to deploy the application to Linux after deploying on…
mmr
  • 14,781
  • 29
  • 95
  • 145
24
votes
5 answers

How to make sure the numpy BLAS libraries are available as dynamically-loadable libraries?

The theano installation documentation states, that theano will as a default use the BLAS libraries from numpy, if the "BLAS libraries are available as dynamically-loadable libraries". This seems not to be working on my machine, see error…
Framester
  • 33,341
  • 51
  • 130
  • 192
24
votes
3 answers

CMake warnings under OS X: MACOSX_RPATH is not specified for the following targets

I try to build a CMake-based software under OS X (Yosemite) which can be built successfully under Fedora 21. It uses a bunch of libraries. Both, big open ones like Boost and some self-written ones lying in /installation_folder/lib. I use CMake…
fotinsky
  • 972
  • 2
  • 10
  • 25
24
votes
3 answers

how to set breakpoint on function in a shared library which has not been loaded in gdb

I have a shared library libtest.so which will be loaded into the the main program using dlopen. Function test() reside in libtest.so and will be called in the main program through dlsym. Is there any way I could set up a break point on test? Please…
pierrotlefou
  • 39,805
  • 37
  • 135
  • 175
24
votes
2 answers

Is there any way to decompile Linux .so?

Is there any way to decompile Linux .so?
Rella
  • 65,003
  • 109
  • 363
  • 636
24
votes
2 answers

Cannot find libcrypto library error

When i am trying to compile a C code which uses openssl 'crypto' library functions with comand line -lcrypto with gcc 4.4.3 it gives an error `@ubu:$ gcc -ggdb aes_m.c -Werror -Wall -I /usr/local/ssl/include/ -lcrypto -o aes /usr/bin/ld: cannot…
abhi
  • 3,476
  • 5
  • 41
  • 58
24
votes
3 answers

Is there any way to use StaticResource in a WPF control library and be able to view at design-time?

I have a WPF Control Library that is being added to a windows forms application. We want to allow the controls to be localizable, however I am not sure how to FULLY accomplish this without duplicating code. This is what I am doing now. Basically, in…
Justin Pihony
  • 66,056
  • 18
  • 147
  • 180