shared-libraries

While migrating from Heroku Bamboo to Cedar stack, some native libraries are missing! How to fix it?

牧云@^-^@ 提交于 2019-12-05 14:40:28
I am migrating a production app from bamboo stack to cedar, I successfully pushed the app on cedar but resulting in error like LoadError: Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory from /app/vendor/bundle/ruby/1.9.1/gems/ffi-1.0.9/lib/ffi/library.rb:75:in `block in ffi_lib' from /app/vendor/bundle/ruby/1.9.1/gems/ffi-1.0.9/lib/ffi/library.rb:54:in `map' from /app/vendor/bundle/ruby/1.9.1/gems/ffi-1.0.9/lib/ffi/library.rb:54:in `ffi_lib' 0.1.3/lib/tidy_ffi/interface.rb:5:in `' Looks like some native libs are missing on Cedar stack which

How to know which functions of a library get called by a program

你。 提交于 2019-12-05 14:06:12
Assume I have binary library (*.so) and a binary program using that library (i.e. I do not own the source code for either). How can I find out which of the library's functions are called at run time. I would like to know their names, but do not need live info. Neither of the binaries includes debugging symbols. The objdump command dumps external symbol references from a binary. The typical use case involves running it with the -T option, to dump a binary's external symbol references. For example, running objdump -T on /bin/ls : /bin/ls: file format elf64-x86-64 DYNAMIC SYMBOL TABLE:

cmake find_package specify path

浪子不回头ぞ 提交于 2019-12-05 13:11:58
问题 I have 2 versions of OpenCV installed on my machine. One is in /usr/local/opencv3.1 . I presume the install location of the other one (version 3.4) is /usr/local . Anyway, find_package(OpenCV 3.0 REQUIRED) sets OpenCV_DIR:PATH=/usr/local/share/OpenCV . This folder contains: haarcascades OpenCVConfig.cmake OpenCVModules-release.cmake java OpenCVConfig-version.cmake valgrind_3rdparty.supp lbpcascades OpenCVModules.cmake valgrind.supp In this case, version 3.4 is used. How can I specify in

malloc function interposition in the standard C and C++ libraries

眉间皱痕 提交于 2019-12-05 12:38:09
I want to write a shared library in such a way that it is possible to isolate it’s memory usage from the application it is linked against. That is, if the shared library, let’s call it libmemory.so , calls malloc , I want to maintain that memory in a separate heap from the heap that is used to service calls to malloc made in the application. This question isn't about writing memory allocators, it more about linking and loading the library and application together. So far I’ve been experimenting with combinations of function interposition, symbol visibility, and linking tricks. So far, I can’t

Why do some DLL files need an additional .lib file for linking?

守給你的承諾、 提交于 2019-12-05 11:39:28
问题 I have a question about library linking and .lib files... this is the context: OS = Windows IDE = QT I have created a DLL: MyLib.dll. To use that library in my QT project, I only have to include an include path, a link to the library and use the header files: LIBS += "C:\myPath\MyLib.dll" INCLUDEPATH += "C:\myPath" HEADERS += \ ../myPath/MyLib_global.h \ ../myPath/mylib.h I am using a third party dll in my project: third.dll If I do the same as in the above example, it does not work: LIBS +=

Linux executable can't find shared library in same folder

拟墨画扇 提交于 2019-12-05 10:46:47
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 libraries: libSDL2_mixer-2.0.so.0: cannot open shared object file: No such file or directory although

Writing dependencies in makefile, with makefile

大兔子大兔子 提交于 2019-12-05 10:39:09
Based on some SO questions -- and some further reference found --, I'm trying to build a makefile able to: find, given the directories in $(SRC) , the .cpp files to be compiled; compile the .cpp , producing .o objects; generate .so shared objects from each .o formerly compiled. What the make file is supposed to do to achieve that is: find, given the directories in $(SRC) , the .cpp files to be compiled; build the dependency list for each .cpp using -MM compiler's flag; annotate/add each dependency using $(eval ...) ; evaluate/solve each dependency found, producing both the .o and .so files.

How to load a native shared object, in a jar, from an android application?

爷,独闯天下 提交于 2019-12-05 10:26:34
I've got a shared object, which I'll call 'libFoo.so', compiled against the NDK. I have a java project (I'll call it 'jarlib') that makes use of that shared object, by calling System.loadLibrary("Foo"); That java project, I export as a jar, and use in an android application. If I comment out all the bits about the shared object, the jar works fine, and I'm able to interact with it perfectly. I can use jarlib, along with the shared object from a Unity android application with the shared object in ./lib/armeabi/libFoo.so, and it loads it up all peachy. I'm trying to use the jarlib and libFoo.so

std::any across shared library bounding in mingw

别等时光非礼了梦想. 提交于 2019-12-05 09:57:33
I stumbled about an issue while using libstdc++'s std::any implementation with mingw across a shared library boundary. It produces a std::bad_any_cast where it obviously should not (i believe). I use mingw-w64, gcc-7 and compile the code with -std=c++1z. The simplified code: main.cpp: #include <any> #include <string> // prototype from lib.cpp void do_stuff_with_any(const std::any& obj); int main() { do_stuff_with_any(std::string{"Hello World"}); } lib.cpp: Will be compiled into a shared library and linked with the executable from main.cpp. #include <any> #include <iostream> void do_stuff_with

Converting .DLL to .SO

随声附和 提交于 2019-12-05 09:07:54
Can any one of you help me in converting an windows dll file in a .so file. You might try re-compiling the source code to the dll to a shared object. This may help you get started, after ensuring the code is indeed portable. Edit: Here is yet another link that can help guide you through the process of creating a shared library using GCC and other parts of the GNU tool chain. This link will help you to discover pitfalls that other people had when undertaking a project similar to this. There is only so much help that can be provided for such a specific task, especially with so many unknowns. If