shared-libraries

Cython buildable (Python Binded) C code to download file via HTTP (REST API)

落爺英雄遲暮 提交于 2020-01-16 11:34:42
问题 I have been googling and searching some good example(s) and so far somewhat closest was this one: Architecting a RESTFul C++ api to interface with Python In a nutshell: Essentially, I am building .so files using cython (via building Python Extension module with Bindings from *.c source file). Scope/Requierments: As first prio - I need to add codebase in *.c file that lets to download an file from certain endpoint (lets say some cloud storage) and as bonus would be able to communicate with

Cython buildable (Python Binded) C code to download file via HTTP (REST API)

早过忘川 提交于 2020-01-16 11:32:08
问题 I have been googling and searching some good example(s) and so far somewhat closest was this one: Architecting a RESTFul C++ api to interface with Python In a nutshell: Essentially, I am building .so files using cython (via building Python Extension module with Bindings from *.c source file). Scope/Requierments: As first prio - I need to add codebase in *.c file that lets to download an file from certain endpoint (lets say some cloud storage) and as bonus would be able to communicate with

symbol lookup error despite the symbol being present in linked library

浪尽此生 提交于 2020-01-16 00:50:16
问题 My executable is linked against several libraries (see below), but at run-time crashes with this error: symbol lookup error: bin.gcc/TestHarmonic: undefined symbol: _ZN3fmm8harmonic7details6helperILi2ENS0_6U_typeEdE5set_qEPdPKddd The executable is made using (on linux, running gcc 4.8.1) g++ -o bin.gcc/TestHarmonic obj.gcc/TestHarmonic.o -Llib/ -lfmm.gcc -Lutils2/lib -lWDutils2.gcc -ltbb -lCGAL -lm The symbol in question is actually where it ought to be: nm lib/libfmm.gcc.so | grep

Can a dynamically linked library override a static one?

♀尐吖头ヾ 提交于 2020-01-15 10:14:55
问题 nokogori gem comes with its own version of libxml2 . Moreover it warns about libxml2.so of a different version being loaded before it was required: if compiled_parser_version != loaded_parser_version ["Nokogiri was built against LibXML version #{compiled_parser_version}, but has dynamically loaded #{loaded_parser_version}"] It basically compares LIBXML_DOTTED_VERSION macro and xmlParserVersion global variable: rb_const_set( mNokogiri, rb_intern("LIBXML_VERSION"), NOKOGIRI_STR_NEW2(LIBXML

Debugging strategies for libraries open with dlmopen

南笙酒味 提交于 2020-01-15 06:10:35
问题 I have an executable that loads a shared library with dlmopen . Here is the main.cpp: int main(int argc, char* argv[]) { void* h=dlmopen(LM_ID_NEWLM,"libA.so", RTLD_LOCAL | RTLD_NOW); if(h != 0) { void (*pPrint)() = (void (*)())dlsym(h, "printA"); if (pPrint != 0) pPrint(); else std::cerr << "Did not find function\n"; } else { std::cerr << "Cannot load shared library\n"; return 100; } return 0; } And here is A.cpp producing the library: extern "C" void printA() { std::cout << "Hello world!\n"

How to blacklist a shared library to avoid it being fetched by the loader?

与世无争的帅哥 提交于 2020-01-14 10:32:29
问题 I'm trying to force a build internal pre-processor used for built-sources to not rely on shared libraries installed in my host machine without having to uninstall them. Although there is a LD_PRELOAD environment variable which forces the loader (ld-linux) to fetch the specified shared libraries before anything else, I'd like to do quite the opposite, forcing the loader not to fetch the specified libraries during the setup process (kind of LD_NEVERLOAD variable). Is there some way to do so

Linux executable can't find shared library in same folder

喜夏-厌秋 提交于 2020-01-13 10:29:26
问题 I am relatively new to Linux development, having been using Windows for a while now. Anyway, I am compiling a C++ game using g++ on both Windows and Linux (using mingw32 when needed), and am linking against SDL2 and SDL2_mixer. On Windows, one would only need to put the DLL files in the same folder as the executable and everything would run fine. On Linux however, although the code compiled just fine with not even a single warning, I get this at runtime : ./nKaruga: error while loading shared

statically linked shared object? Or a corrupt file?

爱⌒轻易说出口 提交于 2020-01-13 09:54:14
问题 I have a library that I got from a proprietary source and I'm trying to link against it but I'm getting the following error libxxx.so: file not recognized: File format not recognized collect2: ld returned 1 exit status and indeed $ ldd ./libxxx.so statically linked what does that exactly mean? Never saw a statically linked .so in my life. It might be worth noting that the last version of the same software included the same .so for which ldd shows the "normal" output and that works fine. $

how to load libandroid_runtime

房东的猫 提交于 2020-01-13 04:52:30
问题 I'm working on a project that gets compiled into a JAR and then deployed using javaws. In one of my classes, I need to load the libandroid_runtime.so found in directory /system/lib/ on the device. How do I do this? System.load("libandroid_runtime")throws java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: libandroid_runtime System.loadLibrary("/system/lib/libandroid_runtime.so") throws java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: /system

How to change interpreter path and pass command line arguments to an “executable” shared library on Linux?

微笑、不失礼 提交于 2020-01-12 16:06:18
问题 Here is a minimal example for an "executable" shared library (assumed file name: mini.c ): // Interpreter path is different on some systems //+definitely different for 32-Bit machines const char my_interp[] __attribute__((section(".interp"))) = "/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2"; #include <stdio.h> #include <stdlib.h> int entry() { printf("WooFoo!\n"); exit (0); } If one compiles it with e.g.: gcc -fPIC -o mini.so -shared -Wl,-e,entry mini.c . "Running" the resulting .so will look