shared-libraries

loading .so library C++

巧了我就是萌 提交于 2019-12-11 10:48:49
问题 I'm trying load library library.so, when i try if exist return true, but when I use dlopen return library doesn't exist. std::ifstream ifile("library.so"); if (ifile) { cout << "Exist!" << std::endl; } cout << "C++ dlopen demo\n\n"; // open the library cout << "Opening hello.so...\n"; void* handle = dlopen("library.so", RTLD_LAZY); if (!handle) { cerr << "Cannot open library: " << dlerror() << '\n'; return 1; } 回答1: dlopen is quite restricted in the paths it can search (to keep it short: the

How to make an EAR refer WAR shared library

假如想象 提交于 2019-12-11 10:47:01
问题 I would like to get a help from you all. The below is the issue I am currently facing with. I have added a reference of WAR shared library in weblogic-application.xml of EAR file. In EAR, I do have a ejb module which has "library-directory" tag in application.xml. I want ejb module to refer jar files in shared library but it looks for jar files in lib folder of EAR. In lib folder of EAR, jar files are not available but the jars are available in WAR shared library. How to resolve this issue

Yet another ffmpeg/libx264 issue

两盒软妹~` 提交于 2019-12-11 10:24:12
问题 My current situation is; ffmpeg and libx264 has been compiled for Android, as shared and static libraries respectively. Since I have libx264.a and libffmpeg.so with me, only thing that remains is to link them and obtain a ffmpeg library that would allow me to proceed with my application. However, some questions remain unanswered. I am using Ubuntu with a virtual machine under Windows 7. I am using x264's last version, ffmpeg 0.10.4 release and NDK 7. I have tried to adjust flags (extracf and

FTDI driver library fail on run

懵懂的女人 提交于 2019-12-11 10:08:09
问题 4 to program a Raspberry Pi B with Raspian Wheezy. My pi has custom daughter board with an FTDI usb/serial chip FT231X. I located a driver for this device ( FTD2xx.1.1.12 ) which comes with a few example programs. As per the docs I installed the drivers ( .a and .so ) to /usr/loca/lib and then ran one of the example programs. This was done using the SSH client ie not from Netbeans. There o build errors and the program ran without errors. Now when I try and include the static library in my

build R from source: links to shared libraries failed

五迷三道 提交于 2019-12-11 09:45:41
问题 I have been scratching my head for more than a week, with no answer to my issue. I want to build R from cran source with Intel MKL 1 as a shared library. Here is the small script I use to test my configuration: #! /bin/sh export MKL=/opt/intel/compilers_and_libraries_2016.0.109/linux/mkl MKL=" -L${_mkllibpath} \ -Wl,--start-group \ -lmkl_gf_lp64 \ -lmkl_gnu_thread \ -lmkl_core \ -Wl,--end-group \ -lgomp -lpthread" ./configure --prefix=/usr \ --libdir=/usr/lib \ --datarootdir=/usr/share \

How to build a shared and a static library without recompiling the sources with CMake

别等时光非礼了梦想. 提交于 2019-12-11 08:18:33
问题 I want to build both a static and shared version of the same library as described here. However, the sources are compiled twice, one for each version which is not necessary. Any ways of avoiding this ? 回答1: Depends on the platform. On Linux at least, you need to use different compiler flags to produce position-independent (shared library) than ordinary (program or static library) code. 来源: https://stackoverflow.com/questions/8912938/how-to-build-a-shared-and-a-static-library-without

Qt static build - impossible size

让人想犯罪 __ 提交于 2019-12-11 08:17:14
问题 I am quite new to Qt programming, and i tried long to understand how linking the libraries work. I need to distribute a small program - 1000 lines or so - that i developed to a few people. I built statically Qt because I need a static build , and now my programs size increased drammatically. I only use Qpushbuttons, Qlinedits, Qlabels, and a few more things and I ended up with a compiled program of over 160Mb, while just a few MB would be reasonable . I assume it included unwanted libraries

Creating an object in shared memory inside a Shared Lib (so) in C++

无人久伴 提交于 2019-12-11 07:48:50
问题 Is it possible to share a single 'god' instance among everyone that links to this code, to be placed in a shared object? god* _god = NULL; extern "C" { int set_log_level(int level) { if(_god == NULL) return -1; _stb->log_level(level); return 0; } int god_init(){ if(_god == NULL){ _god = new god(); //Magic happens here } } } Provided that I perform a lock synchronization at the beginning of every function, and considering that God itself can new/malloc other things, but those things will never

shared library compiles, but has undefined symbols

谁说我不能喝 提交于 2019-12-11 07:35:36
问题 I am getting something like the following: Exception in thread "main" java.lang.UnsatisfiedLinkError: no viewerNativeDLL in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at viewer.SarBufferedImage.<clinit>(SarBufferedImage.java:356) at viewer.viewerJPanel.<init>(viewerJPanel.java:34) at viewer.ViewerView.initComponents(ViewerView.java:457) at viewer.ViewerView.

Which function is used when loading two shared libraries with same statically linked functions

删除回忆录丶 提交于 2019-12-11 07:32:55
问题 I been reading and trying to understand how symbols get resolved within a shared library in Linux. So here is a description of what I am faced with. I am using an application ( APP ) that can load user created shared libraries to add features. I have two such libraries, LIB_A.so and LIB_B.so that perform separate things and do not depend on another to work. They are independently compiled and based on the compiler arguments ( -fPIC ), will seem it will make the symbols interposable (from my