shared-libraries

Library path order for alternate glibc dynamic linker (ld.so)

我与影子孤独终老i 提交于 2019-12-05 01:46:27
I need to use an alternate glibc version, newer than the one installed on my system ( 2.18 vs 2.15 ). Several related issues are covered here and here . The specific question I'm asking here is the following: I set up the library path of the new dynamic linker ( ld-2.18.so ) so that the new libc ( libc-2.18.so ) is found ahead of the old libc ( libc-2.15.so ). However, when I try to run a program with the new ld , the old version of libc is picked up, generating a SEGV . Why is that happening? Note: I know this can be fixed by using --rpath at compile time or LD_LIBRARY_PATH at run time.

Phonegap 3.3 Eclipse: -CordovaLib project missing Android properties

六眼飞鱼酱① 提交于 2019-12-05 01:28:05
问题 Trying to import new PhoneGap 3.3 project into Eclipse 4.3.1 - after initial phonegap CLI build I import 2 projects (HelloWorld and HelloWorld-CordovaLib). I get "The import org.apache.cordova cannot be resolved" error as CordovaLib seems not to be linked as library to the HelloWorld project. However, I am not able to flag the CordovaLib project in its Android properties as "Is library" (as per this post) because there is no Android section in its properties (the project seems not to behave

how to build libjpeg for ndk use

为君一笑 提交于 2019-12-05 01:18:16
问题 I download libjpeg-8d source code. I want to compile it to libjpeg.so which could be used in android ndk. Because ndk use arm architecture, but the gcc of my PC is x86 architecture. So when I use gcc to compile out libjpeg.so and put it into jni folder. It shows file format can not recorgnize when use ndk-build. So how to build correct libjpeg.so for ndk? 回答1: You can find libjpeg 8d with an Android makefile here: https://github.com/folecr/jpeg8d Alternatively, consider using libjpeg-turbo

What is the right way to deploy files for a remote debug launch in Eclipse CDT?

余生颓废 提交于 2019-12-05 01:05:39
问题 My situation: I'm currently trying to use Eclipse CDT as a replacement for a proprietary IDE. I have an enterprise application, which consists of an executable and a lot (30+) of shared library modules. The application is targeted for an embedded non-x86 platform, with POSIX-compatible operating system (QNX or GNU/Linux, depending on the selected toolchain). Because of that, debugging can't be done on a developer's machine. It has to be done remotely. I'm using Eclipse Luna / CDT 8.5 with

Unknown reference to __dlopen in dlopen

 ̄綄美尐妖づ 提交于 2019-12-05 00:30:27
问题 dlopen is located in libdl.a but when I link my application against libdl.a , gcc linker throw this error : unknow reference to __dlopen called in dlopen Should I import another .a ? 回答1: When I try to compile statically a dlopen mockup program, gcc (Archlinux/gcc version 4.6.1 20110819 (prerelease)) tells me: $ gcc test.c -ldl -static /tmp/ccsWe4RN.o: In function `main': test.c:(.text+0x13): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries

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

爷,独闯天下 提交于 2019-12-05 00:19:28
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? Compiling position-independent code when not necessary is a performance drag on some platforms (most notably, the register-starved x86 architecture, because PIC takes away a

Do dynamic libraries break C++ standard?

前提是你 提交于 2019-12-04 23:59:36
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 destructors have been run prematurely ? They are only run prematurely if you go to great effort to do so

What is the Effect of Declaring 'extern “C”' in the Header to a C++ Shared Library?

这一生的挚爱 提交于 2019-12-04 23:40:07
问题 Based on this question I understand the purpose of the construct in linking C libraries with C++ code. Now suppose the following: I have a '.so' shared library compiled with a C++ compiler. The header has a 'typedef stuct' and a number of function declarations. If the header includes the extern "C" declaration... #ifdef __cplusplus extern "C" { #endif // typedef struct ...; // function decls #ifdef __cplusplus } #endif ... what is the effect? Specifically I'm wondering if there are any

g++ compile error: undefined reference to a shared library function which exists

柔情痞子 提交于 2019-12-04 23:26:24
I recently installed the hdf5 library on an ubuntu machine, and am now having trouble linking to the exported functions. I wrote a simple test script readHDF.cpp to explain the issue: #include <hdf5.h> int main(int argc, char * argv[]) { hid_t h5_file_id = H5Fopen(argv[1], H5F_ACC_RDWR, H5P_DEFAULT); return 0; } The compile command is g++ -Wl,-rpath,$HOME/hdf5/lib -I$HOME/hdf5/include \ -L$HOME/hdf5/lib -l:$HOME/hdf5/lib/libhdf5.so readHDF.cpp which returns the following error /tmp/cc6DXdxV.o: In function `main': readHDF.cpp:(.text+0x1f): undefined reference to `H5check_version' readHDF.cpp:(

What is causing sprof to complain about “inconsistency detected by ld.so”?

给你一囗甜甜゛ 提交于 2019-12-04 23:02:24
I'm trying to use sprof to profile some software (ossim) where almost all the code is in a shared library. I've generated a profiling file, but when I run sprof, I get the following error: > sprof /home/eca7215/usr/lib/libossim.so.1 libossim.so.1.profile -p > log Inconsistency detected by ld.so: dl-open.c: 612: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed! The instructions I was following said that I needed libc version at least 2.5-34, I have libc version 2.12.2 (Gentoo, kernel 2.6.36-r5). I can't find any explanation as to what the error means or