shared-libraries

Converting .DLL to .SO

ぐ巨炮叔叔 提交于 2019-12-07 02:23:59
问题 Can any one of you help me in converting an windows dll file in a .so file. 回答1: You might try re-compiling the source code to the dll to a shared object. This may help you get started, after ensuring the code is indeed portable. Edit: Here is yet another link that can help guide you through the process of creating a shared library using GCC and other parts of the GNU tool chain. This link will help you to discover pitfalls that other people had when undertaking a project similar to this.

MADlib apt install, how to?

不想你离开。 提交于 2019-12-07 02:21:54
问题 MADlib is the most complete, efficient (faster functions) and reliable Mathematical library for PostgreSQL... At official download no clues about Debian or UBUNTU "plug-and-play installation". Checking other fonts, the best (simplest) is an old 2013's instruction for apt-get it. ... Also some lost-script of 2014... A comment say "can download the .rpm packages and to install in Ubuntu just convert the package to .deb using Alien command it will work". Question: secure and simplest way to

debugging ld, “Inconsistency detected by ld.so”

*爱你&永不变心* 提交于 2019-12-07 01:42:32
问题 I am trying to use a widget library called GLV for an application I am developing. I am running Linux Mint 17. I installed all the libraries and I have succeeded in building the GLV library, but when I try to running one of samples that was built I get this shared library error. Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed! Can anyone help me find out where the inconsistency in the shared library is coming from? More

When exactly is gcc __attribute__((constructor)) run?

安稳与你 提交于 2019-12-07 01:21:22
问题 Let's say I have an libA.so with GCC constructor. My program "program" depends on libA.so, so when I run it, libA.so gets opened and its constructor is executed. Now, I also have a module, libC.so, which also depends on libA. I run dlopen("libC.so") , which loads libC, and according to my experiments, also executes libA's constructor . Dependencies look like this: libA has the constructor libB also has a constructor libC depends on libA and libB program depends on libA program links libC via

Solaris linker equivalent to the GNU LD --export-dynamic flag

自古美人都是妖i 提交于 2019-12-07 00:53:31
Like the question says: We are building on Linux using the GNU linker, and on Solaris using the solaris ld . GNU ld supports the --export-dynamic flag, which: When creating a dynamically linked executable, add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time. What is the equivalent to this flag using the solaris linker? Is there an equivalent? vladr The Sun Studio linker ( ld ), by default, exports all symbols. You can find the complete reference for the Sun linker on docs.sun.com. Search for the "Linker

Linking libraries with incompatible dependecies

。_饼干妹妹 提交于 2019-12-06 23:15:39
问题 I'm working on a C++ project that needs two third party libraries ( libfoo.so and libbar.so ). My operating system is Linux. libfoo.so is dynamically linked to libpng14.so.14 (1.4.8) (EDIT 1) libbar.so seems to be statically linked to an unknwon version of libpng libpng 1.2.8 (EDIT 1) I say "seems to be" because: ldd libbar.so doesn't show nothing about png nm -D libbar.so | grep png_read_png says "004f41b0 T png_read_png" less libbar.so | grep png_read_png says "4577: 004f41b0 738 FUNC

Sharing an Android library between multiple Android apps using Gradle

为君一笑 提交于 2019-12-06 20:52:30
问题 I have Android apps A and B. I want to extract duplicate code from each into a shared library L. How can I do this using Gradle? I've seen a few permutations of this question asked before, but there were very few answers. The closest/best already-asked question is this one: Multiple Android apps depending on android library with gradle The first answer suggests a parent project that encompasses both apps and the library module. This coupling is undesirable, in part because A, B, and L are in

What, if any, are the implications of compiling objects with gcc -fPIC flag if they get used in executables?

一曲冷凌霜 提交于 2019-12-06 20:14:32
问题 I am putting together a makefile for a project i am working on. I have an executable and a shared library in the project. Both use some of the same source files which get compiled separately into object files. To be able to use these objects in the shared library I need to use the -fPIC (position independent code) flag in gcc. Are there any implications of compiling objects with -fPIC that get used in a executable? 回答1: Compiling position-independent code when not necessary is a performance

Do dynamic libraries break C++ standard?

一世执手 提交于 2019-12-06 16:52:37
问题 The C++ standard 3.6.3 states Destructors for initialized objects of static duration are called as a result of returning from main and as a result of calling exit On windows you have FreeLibrary and linux you have dlclose to unload a dynamically linked library. And you can call these functions before returning from main. A side effect of unloading a shared library is that all destructors for static objects defined in the library are run. Does this mean it violates the C++ standard as these

Wrapping symbols during linking on OS X

自闭症网瘾萝莉.ら 提交于 2019-12-06 16:40:56
I'm trying to wrap one symbol by another during link. As I understand this is easily done with ld --wrap option, but on OS X it's not available. There is '-idefinition:indirection', here how I'm trying to cheat main so it will print 42: a.cpp: int foo() { return 1; } b.cpp: int wrap_foo() { return 42; } main.cpp: #include <cstdio> int foo(); int wrap_foo(); int main() { printf("%d\n", foo()); } How I build and link them: $ gcc -c *.cpp $ gcc -Wl,-i__Z3foov:__Z8wrap_foov *.o duplicate symbol __Z3foov in: a.o b.o ld: 1 duplicate symbol for architecture x86_64 Is it even possible to achieve what