dynamic-linking

Can an executable be linked to a dynamic library after its built?

别说谁变了你拦得住时间么 提交于 2019-12-13 03:53:44
问题 I have built a binary 'foo'. I now want the executable to be a linked to a dynamic library 'bar'. How can I link foo to bar?(using ld or any other way). I don't want to use DYLIB_INSERT_PATH on OSX or its equivalent LD_PREOAD on Linux. I want to do this on OSX, but this question is a generic one. 回答1: What's your intention? The link process resolves symbols: it provide satisfactions to needs. If the executable doesn't need any symbols offers by the dynamic library, the linker will entirely

buildroot file system & cross compiling: dynamically linked application fails but static ok. How to link against uClibc

我是研究僧i 提交于 2019-12-12 22:02:04
问题 I have a buildroot created file system, and I am trying to execute some c-code on lighttpd server. I have created a simple C module that just prints out few lines of html. Code looks like this: #include "stdio.h" int main(void) { printf( "Content-Type: text/plain\n\n" ); printf("testing C code\n"); return 0; } I'm using compiler from Ubuntu repository, to compile it arm-linux-gnueabi-gcc -o test.cgi test.c . If I compile with -static flag, it will run just fine, and I can see the html

Linking error: libQt5Network.so: undefined reference to `EC_curve_nist2nid'

女生的网名这么多〃 提交于 2019-12-12 18:18:41
问题 I'm building my qt application and on a linking stage I'm getting the following problem: /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib/libQt5Network.so: undefined reference to `EC_curve_nist2nid' collect2: error: ld returned 1 exit status I was not getting this problem before and I have a feeling that it is in some way related to system update (though nor qt nor openssl packages were updated). My system is Arch Linux Qt 5.5.1 openssl 1.0.2.f-1 And btw the symbol is present in

does dynamic library shared global variable in linux

混江龙づ霸主 提交于 2019-12-12 16:51:25
问题 As we know, linux call ldconfig to load all *.so libraries and then link the applications who use the shared library. However, I am confused how the global variable is working in this case. Since there is only one copy of shared library across all these application, do they share the global variables in the shared library? If yes, then how they synchronize? Thanks, 回答1: No it is not shared - the code/text section of the library is shared - the data portion is unique to each process that uses

find_library or link_directories or find_package? What is better way? Error - Link libraries using cmake

假装没事ソ 提交于 2019-12-12 16:24:36
问题 Given The file /usr/lib/gstreamer-0.10/libgstffmpeg.so is present Making changes in CMakeLists.txt Approach 1 find_library() find_library(GST_FFMPEG NAMES gstffmpeg PATHS /usr/lib/gstreamer-0.10/ ) ... target_link_libraries( MyLibraryOrMyExecutable ${GST_FFMPEG} ) When I run make with above configuration(approach 1), I get the following errors /bin/ld: warning: libvpx.so.1 , needed by /usr/lib/i386-linux-gnu/libavcodec.so.53, not found (try using -rpath or -rpath-link) /bin/ld: warning:

What are the use cases of dlopen vs standard dynamic linking?

不羁的心 提交于 2019-12-12 13:33:24
问题 According to the doc, dlopen is used in conjunction with dlsym to load a library, and get a pointer to a symbol. But that's already what the dynamic loader/linker does. Moreover, both methods are based on ld.so. There actually seems to be two differences when using dlopen : The library can be conditionally loaded. The compiler is not aware of the symbols (types, prototypes...) we're using, and thus does not check for potential errors. It's, by the way, a way to achieve introspection. But, it

iOS Download code when app is running

好久不见. 提交于 2019-12-12 06:23:17
问题 I am aiming at downloading code (library / framework / bundle) when the app is running. This is like download specific modules based on user's ACL. I have gone through creating static library and framework which seems like we need them when code signing app. But I need the code to be downloaded when user is using the app and run that code. Pls provide some samples 来源: https://stackoverflow.com/questions/35202560/ios-download-code-when-app-is-running

Incorrect shared libraries picked in AIX

痴心易碎 提交于 2019-12-12 04:59:34
问题 While building a particular module, I get the below error: ld: 0711-317 ERROR: Undefined symbol: .MD5_Init ld: 0711-317 ERROR: Undefined symbol: .SHA1_Init ld: 0711-317 ERROR: Undefined symbol: .SHA224_Init ld: 0711-317 ERROR: Undefined symbol: .SHA256_Init ld: 0711-317 ERROR: Undefined symbol: .SHA384_Init ld: 0711-317 ERROR: Undefined symbol: .SHA512_Init ld: 0711-317 ERROR: Undefined symbol: .SHA1_Update ld: 0711-317 ERROR: Undefined symbol: .SHA1_Final ld: 0711-317 ERROR: Undefined symbol

Dynamic linking in C/C++ (dll) vs JAVA (JAR)

匆匆过客 提交于 2019-12-12 04:11:07
问题 I am new to java programming. Basically when we work in c/c++ programming we create dll files using .h and .c files,where .h file contains declarations and .c file contains definitions of those classes, functions. when we want to use those functionalities of created .dll file in other project, we include .h in preprocessor declaration to tell compiler about declarations of variables,functions and we provide respective dll file path during compilation so that at linker stage it communicates

Program use two conflicting shared libraries

假装没事ソ 提交于 2019-12-12 02:26:15
问题 I have a shared library A.so . There is a function foo() defined in it. This foo() function depends on a shared library libnl-1.so . The relationship is below: A.so { foo() => libnl-1 } I have a program app . It calls two functions, foo() and bar() . bar() needs another version of libnl, libnl-3. The relationship is below: app { foo() bar() => libnl-3 } I compiled app using cc -o app -lnl-3 -lA . But I found my app always crashes. It seems that foo() is calling into libnl-3 instead of libnl-1