shared-libraries

How can I make lazy/delay loading work in Linux?

ぃ、小莉子 提交于 2019-12-08 02:41:23
问题 I got this working great on Windows -- application loads my plugin (C++, Qt), my plugin does a smart search to find an installed JRE, sets the library search path accordingly, and then calls a function in the JVM which forces the jvm.dll to be loaded at that point. (Previous question: How can I deploy a mixed C++/Java (JNI) application?) Now I'm trying to get it working on Linux. From what I read, lazy linking/loading was the default, so I thought it would just work.... doesn't seem like it.

Telegram for Android, confusing NDK error

六月ゝ 毕业季﹏ 提交于 2019-12-08 02:29:08
问题 So I have downloaded Telegram messenger source from GitHub, and I am trying to get it to run on Android Studio for the first time. Now the error is as below: The build failed message is: Error:error: CreateProcess: No such file or directory The detailed log in Gradle Console is: FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':TMessagesProj:externalNativeBuildArmv7Debug'. Build command failed. Error while executing process D:\AndroidStudio\sdk\ndk-bundle

Problems Linking to libcuda.so

巧了我就是萌 提交于 2019-12-08 02:23:41
问题 I am stumped by what seems to be a problem that should be easy to diagnose and fix. I have a C++ source file that makes use of the CUDA Driver API. When I compile it using nvcc , the executable is produced and works without problems. However, when I try to compile it using g++ , the linker complains about undefined references to symbols that are in /usr/lib/libcuda.so : undefined reference to cuDeviceGet' ... undefined reference to cuDeviceComputeCapability' ... undefined reference to

Using CDI in a websphere shared library

醉酒当歌 提交于 2019-12-08 02:09:56
问题 We use a shared library defined in the websphere admin console to share classes between several applications. I was wondering if it is possible to use CDI (Context and Dependecy Injection) in these classes? If so do I just need to put the beans.xml in the jar that is in the shared library, or are there further steps? Note: I can't move away from using a shared library, as this would be too much refactoring work. 回答1: No, classes included in a shared library are not considered as CDI beans.

Automatically Creating Wrappers for Classes Loaded with dlopen()

佐手、 提交于 2019-12-08 01:52:29
问题 I'm writing a proxy class that loads a shared library with dlopen() and forwards its member functions to the appropriate members of the proxied class instance inside the loaded shared object behind the scenes. For example, the shared object has a Person class: class Person { ... void setName(std::string name); }; I've added a wrapper file that includes the person.h header and defines the following symbol: extern "C" { void Person_setName(void* instancePointer, std::string name); } This call

Shared library mysteriously doesn't get linked to application

人盡茶涼 提交于 2019-12-08 01:35:58
问题 I have a shared library (libhoard.so) that I'm trying to link with a simple test binary. However, depending on the machine I compile on the shared library doesn't show up in the test binary. I'm not sure what differences exist on the machines and is partly why I'm asking the question. I'm curious what I can do to troubleshoot why the shared library doesn't show up on the test binary on the "broken" machine? I used this command to compile both binaries (libhoard.so is in the same directory): $

Why do I have to explicitly link to pthreads in my main.c compilation when my main.c does not use pthreads?

a 夏天 提交于 2019-12-08 01:29:58
问题 In Linux, I have a shared library I made that uses pthreads and a main.c that does not. libpthread.so shows up in an ldd of my shared library, which is correct. $ ldd libmapreduce.so.1.0 linux-gate.so.1 => (0x0067d000) libpthread.so.0 => /lib/libpthread.so.0 (0x0058c000) [...] But when I compile and link my main.c that does not use pthreads to my shared library that does, I see: $ icc -Wall -o main main.c -lmapreduce /opt/intel/Compiler/11.1/046/lib/ia32/libiomp5.so: undefined reference to

Python freeze.py generated bin doesn't run

本秂侑毒 提交于 2019-12-07 23:46:20
问题 I need to run a Python 2.7 script into a client critical machine, so I have permission to install nothing, and when I say nothing I mean nothing even into local dirs, so the solution I found is to pass him the script as a binary created with the batteries-included tool "freeze.py" http://wiki.python.org/moin/Freeze , and I also added required and unembedable .so libraries into the same folder (_io.so, _heapd.so, ...) and give them executable permisions. But when I try to execute the binary I

How to load native library into native android code? (AndroidStudio)

纵然是瞬间 提交于 2019-12-07 23:33:16
问题 I have a library in C called mylib in the folder jniLibs/your_architecture/mylib.so In Java, to load the library, you just have to type that code in your source: static { System.loadLibrary("mylib"); } But how can you load the library in a native C code (in Android Studio) ? I add that the library don't use the JNI conventions, it's a normal shared library. 回答1: If this can help someone, here how to load a library in native code c/c++ : 1 - to avoid java.lang.UnsatisfiedLinkError: dlopen

intel_sse2 problems when linking to gsl with icc

你离开我真会死。 提交于 2019-12-07 21:30:45
问题 My program links to both PETSc and gsl, and both libraries were compiled with icc. Here's the link command: /usr/local/mpich2/bin/mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -I/usr/local/gsl-icc-1.15/include/ -I/usr/local/gsl-icc-1.15/include/ -L/usr/local/gsl-icc-1.15/lib/ -lgsl -lgslcblas prog_name.o -L/usr/local/petsc-3.2-p6/lib -lpetsc -lX11 -lpthread -llapack -lblas -L/central/intel/Compiler-11.1.072/mkl/lib/em64t -L/central/intel/Compiler-11.1.072/lib