shared-libraries

Shared libraries memory space

五迷三道 提交于 2019-11-30 12:56:36
问题 Does a C++ shared library have its own memory space? Or does it share the caller process' one? I have a shared library which contains some classes and wrapper functions. One of this wrapper function is kinda: libXXX_construct() which initializes an object and returns the pointer to the said object. Once I use libXXX_construct() in a caller program where is the object placed?Is it in the "caller" memory space or is it in the library's memory space? 回答1: A linked instance of the shared library

Cannot open shared object file: No such file or directory; Running or Debugging in Eclipse

时光毁灭记忆、已成空白 提交于 2019-11-30 12:35:12
On Ubuntu, I have a C++ app in Eclipse. The application compiles fine and I can run the app from the command line. But when I try to debug it or run it with Eclipse, the error : "Cannot open shared object file: No such file or directory" is thrown on a shared library. I've set LD_LIBRARY_PATH in my bashrc file and also set an LD_LIBRARY_PATH environment variable in both the Run Configuration and Debug Configuration to : /home/behlingb/Documents/api_libs/FileGDB_API/lib What else am I missing here to get Eclipse to run this? UPDATE There is only one shared object file this application requires,

shared library text segment is not shareable

╄→гoц情女王★ 提交于 2019-11-30 12:30:35
I am trying to add HW video acceleration to a cm10.2 port for my device. I get no errors but the one below, then make stops working, apparently without any error. /home/vektor/CM102/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: warning: shared library text segment is not shareable /home/vektor/CM102/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: treating warnings as errors collect2: error: ld returned 1 exit

Using a global variable in a shared library

守給你的承諾、 提交于 2019-11-30 12:20:20
问题 I am writing an application in C which used a global variable (a logfile structure). In my application I am loading shared libraries dynamically at runtime and I want to use a global variable pointing at the the same logfile structure to do logging in the shared library. This doesn't seem to be possible in the easy approach: declaring the global variable as extern will not work because dlopen() sais that the global variable is an undefined symbol defining the global variable again will work

ld cannot find -l<library>

允我心安 提交于 2019-11-30 11:14:29
I am having trouble installing pyipopt on ubuntu 12.04. During linking, I receive the error: /usr/bin/ld: cannot find -lcoinhsl Even though I know that this library is installed and the .so and .la files are available in /home/mostafa/MyBuilds/CoinIpopt/build/lib/ does anyone have a solution for this? below is the complete return of running setup.py build: root@ubuntu:~/MyBuilds/pyipopt# sudo python setup.py build running build running build_ext building 'pyipopt' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist

Architecturally what is the difference between a shared object (SO) and a dynamic link library (DLL)?

时光毁灭记忆、已成空白 提交于 2019-11-30 10:39:57
问题 The question is pretty much in the title: in terms of OS-level implementation, how are shared objects and dlls different? The reason I ask this is because I recently read this page on extending Python, which states: Unix and Windows use completely different paradigms for run-time loading of code. Before you try to build a module that can be dynamically loaded, be aware of how your system works. In Unix, a shared object (.so) file contains code to be used by the program, and also the names of

How to map function address to function in *.so files

两盒软妹~` 提交于 2019-11-30 10:21:44
问题 backtrace function give set of backtrace how to map it with function name/file name/line number? for ex:- backtrace() returned 8 addresses ./libtst.so(myfunc5+0x2b) [0xb7767767] ./libtst.so(fun4+0x4a) [0xb7767831] ./libtst.so(fun3+0x48) [0xb776787f] ./libtst.so(fun2+0x35) [0xb77678ba] ./libtst.so(fun1+0x35) [0xb77678f5] ./a.out() [0x80485b9] /lib/libc.so.6(__libc_start_main+0xe5) [0xb75e9be5] ./a.out() [0x80484f1] From the above stack how can I get the file name and line number? I did

What is the equivalent of Linux's ldd on windows?

旧时模样 提交于 2019-11-30 10:19:05
问题 What is the equivalent of Linux's ldd on Windows? 回答1: Here is Dependency Walker. http://dependencywalker.com/ 回答2: or the GNU tool : i586-mingw32msvc-objdump -p *.exe | grep 'DLL Name:' 回答3: The dumpbin command can be useful for many things, although in this case dependency walker is probably a little more verbose. dumpbin /dependents some.dll 回答4: PowerShell can do this PS > Start-Process -PassThru calc.exe | Get-Process -Module Size(K) ModuleName ------- ---------- 908 calc.exe 1700 ntdll

Template singleton base class in shared object

北战南征 提交于 2019-11-30 09:40:04
问题 I'm currently porting my project from Windows to Linux. The project consists of a 'main' shared library, several plugins (also shared libraries) and a launcher application. Within the 'main' shared library there's a template singleton class another class can inherit from to use the singleton pattern. The template singleton class is implemented as follows: template<class T> class Singleton { public: static T* getInstance() { if(!m_Instance) { m_Instance = new T(); } return m_Instance; }

Is it possible to statically link against a shared object?

痴心易碎 提交于 2019-11-30 09:15:13
问题 My question is not the same as this question. I'm working on a project with a standalone binary that has no dynamic/external linkage, and runs in a *nix environment. I'm attempting to move to a newer toolset to build with, but some of the static libraries that are available with the older toolset aren't available now -- for example, the crt libraries that provided _start aren't provided in this toolset. I've been digging through the files provided with the vendor's toolset and found some