shared-libraries

Linking archives (.a) into shared object (.so)

本小妞迷上赌 提交于 2020-01-09 08:57:11
问题 I'm compiling some shared objects file into an archive.a : $ g++ -c -Iinclude/ -fPIC -O0 -o object1.o source1.cpp $ g++ -c -Iinclude/ -fPIC -O0 -o object2.o source2.cpp $ ar rvs archive.a object1.o object2.o r - object1.o r - object2.o So far so good. The resulting archive.a has a good size of some KB. A dump with nm shows that the corresponding object-files are contained within the files. Now I'm wanting to compile several of these archives into a shared object file. g++ -g -O0 -Iinclude/ -I

use RPATH but not RUNPATH?

那年仲夏 提交于 2020-01-09 04:18:05
问题 This page - http://labs.qt.nokia.com/2011/10/28/rpath-and-runpath/ - says about order for library search in ld.so: Unless loading object has RUNPATH: RPATH of the loading object, then the RPATH of its loader (unless it has a RUNPATH), ..., until the end of the chain, which is either the executable or an object loaded by dlopen Unless executable has RUNPATH: RPATH of the executable LD_LIBRARY_PATH RUNPATH of the loading object ld.so.cache default dirs And then suggest: When you ship binaries,

Finding address of variable in shared library

孤街醉人 提交于 2020-01-07 19:36:54
问题 I would like to find the address in the .so file of a variable. I do not know the name of if, I only know that it is an integer, and I know the value of it. I also know that once the library is loaded and linked by the dynamic linker the address in the memory is 0x6416A0 relative to the library address. This offset is larger than the size of the dynamic library itself. I only have the binary, compiled version of the library. To find the address of the variable in the .so file I looked at it

Finding address of variable in shared library

冷暖自知 提交于 2020-01-07 19:36:22
问题 I would like to find the address in the .so file of a variable. I do not know the name of if, I only know that it is an integer, and I know the value of it. I also know that once the library is loaded and linked by the dynamic linker the address in the memory is 0x6416A0 relative to the library address. This offset is larger than the size of the dynamic library itself. I only have the binary, compiled version of the library. To find the address of the variable in the .so file I looked at it

Finding address of variable in shared library

旧时模样 提交于 2020-01-07 19:36:10
问题 I would like to find the address in the .so file of a variable. I do not know the name of if, I only know that it is an integer, and I know the value of it. I also know that once the library is loaded and linked by the dynamic linker the address in the memory is 0x6416A0 relative to the library address. This offset is larger than the size of the dynamic library itself. I only have the binary, compiled version of the library. To find the address of the variable in the .so file I looked at it

Dev production libc/libstdc++ mismatch [link libc.so.6/libstdc++.so.6 with older version] [duplicate]

孤人 提交于 2020-01-07 03:44:05
问题 This question already has answers here : Deploying Yesod to Heroku, can't build statically (3 answers) Closed 3 years ago . I built an exec on C++, however when I deploy it to the deployment machine I find errors like :` /lib64/libc.so.6: version GLIBC_2.14 not found /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.14 not found /usr/lib64/libstdc++.so.6: version CXXABI_1.3.5 not found This turns out because the deployment machine is rhel based system with older libc(2.12)/libstdc++(3.4.13)

multiple shared libraries from one project with common source files

人盡茶涼 提交于 2020-01-07 03:09:20
问题 I have a main application wich can be controlled by dynamically loaded plugins (.dll on win - .so on linux). Now i want to create a lot of these plugins where just on function is implemented different. Lets say i have the following files in my Project: plugin.h plugin.cpp i001.cpp i001.cpp contains one implementation of the of the "run" function of my plugin class. Now this Project compiles to "plugin.dll". What i want to achieve is something like this: plugin.h + plugin.cpp + i001.cpp -->

g++ Cygwin/Linux or version discrepancy

一世执手 提交于 2020-01-07 02:49:06
问题 Can someone explain the discrepancy in how two instances of g++ handle compilation of the following code to shared libraries? Foo.h #ifndef Foo_h #define Foo_h void Foo(); #endif // Foo_h Foo.cpp #include "Foo.h" #include <iostream> void Foo() { std::cout << "Greetings from Foo()!" << std::endl; } Bar.h #ifndef Bar_h #define Bar_h void Bar(); #endif // Bar_h Bar.cpp #include "Bar.h" #include "Foo.h" #include <iostream> void Bar() { Foo(); std::cout << "Greetings from Bar()!" << std::endl; }

run Qt app with dependent libraries on mac with no admin rights

≡放荡痞女 提交于 2020-01-06 19:49:12
问题 I am trying to build and run (and fix) an application that was written in Qt 4.8 for windows and then built on Linux. Trying to run it on Mac now. The app requires certain lib dependencies - some of them built separately that I have control over, and a couple purchased sdks. I can build the app fine, having set the location of all the dependent dylibs in the pro file. Unfortunately I cannot execute the app, because the linker doesn't know where my dependencies are located... i guess it

System.loadLibrary() returns exception from static block

霸气de小男生 提交于 2020-01-06 18:03:48
问题 I have created a Java app which loads one Windows DLL from the static initialization block. The code snippet is given below: // MyTestJava class starts class MyTestJava { static { System.loadLibrary("MyLib"); } } // MyTestJava class def ends here I heard that for kinds of library initializations performed from static block, JVM should search in java.library.path . So I set library path for JVM as follows and put MyLib.dll under c:\Libs folder. options[1].optionString = "-Djava.library.path=C: