shared-libraries

Hiding symbols in a shared library on Mac OS X

半腔热情 提交于 2019-12-04 00:48:19
问题 We've been building a large open source software on a variety of platforms (Linux, Windows, Mac OS X, 32-bit and 64-bit) for several years without troubles. Lately however, the Mac OS X build (64-bit) stopped working correctly and started to crash randomly. It more or less coincided with an update of Mac OS X on our build machine from 10.7 to 10.8.2 (but the compiler toolchain didn't change, it's still llvm-gcc 4.2.1). Our application is made of a couple of dynamic (shared) libraries and many

How to install the Six module in Python2.7

烂漫一生 提交于 2019-12-04 00:32:21
问题 I am using Python 2.7 and trying to use dateutil as follows: from dateutil import parser as _date_parser However, I get the following error: Traceback (most recent call last): File "<pyshell#17>", line 1, in <module> from dateutil import parser as _date_parser File "C:\Python27\Lib\dateutil\parser.py", line 24, in <module> from six import text_type, binary_type, integer_types ImportError: No module named six Could you please let me know what is the six module for and how to get it installed

Is it possible to get the signature of a function in a shared library programatically?

核能气质少年 提交于 2019-12-04 00:31:38
The title is clear, we can loaded a library by dl_open etc.. But how can I get the signature of functions in it? This answer cannot be answered in general. Technically if you compiled your executable with exhaustive debugging information (code may still be an optimized, release version), then the executable will contain extra sections, providing some kind of reflectivity of the binary. On *nix systems (you referred to dl_open ) this is implemented through DWARF debugging data in extra sections of the ELF binary. Similar it works for Mach Universal Binaries on MacOS X. Windows PEs however uses

cmake find_package specify path

江枫思渺然 提交于 2019-12-04 00:25:35
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 CMakeLists.txt to use the other version (3.1) knowing its install location? I've tried: find_package(OpenCV

How to avoid having version numbers in .so file name

百般思念 提交于 2019-12-03 23:39:36
I'm trying to build a dynamic library on Linux using qmake. Here is my .pro file: TEMPLATE = lib TARGET = sqxUiBase QT += core gui CONFIG += dll INCLUDEPATH += ../../public/include DEPENDPATH += . UI_DIR += ../GeneratedFiles RCC_DIR += ../GeneratedFiles CONFIG(release, debug|release) { DESTDIR = ../lib/release LIBS += -L"../lib/release" MOC_DIR += ../GeneratedFiles/release OBJECTS_DIR += release } else { DESTDIR = ../lib/debug LIBS += -L"../lib/debug" MOC_DIR += ../GeneratedFiles/debug OBJECTS_DIR += debug } include(sqxUiBase.pri) The sqxUiBase.pri file contains the list of files that need to

Include assets when building library using ng-packagr

泄露秘密 提交于 2019-12-03 23:18:28
Could anyone give a hint where to start to include images and css files into Angular library using ng-packagr? There's an official issue for that question here . It's actually quite simple to include images and the like to your library: You can just copy them to the dist folder manually after ng-packagr has done its thing. However, it's more difficult to automate the extraction of those files in projects that'll use your library. In the issue referenced above BenjaminDobler suggests to add the following mapping to the .angular-cli.json file of any consumer project: { "glob": "**/*", "input": "

Can someone explain about Linux library naming?

久未见 提交于 2019-12-03 22:27:20
When I create a library on Linux, I use this method: Build: libhelloworld.so.1.0.0 Link: libhelloworld.so.1.0.0 libhelloworld.so Link: libhelloworld.so.1.0.0 libhelloworld.so.1 The versioning is so that if you change the public facing methods, you can build to libhelloworld.so.2.0.0 for example (and leave 1.0.0 where it is), so that applications using the old library won't break. However, what's the point in naming it 1.0.0 - why not just stick with libhelloworld.so and libhelloworld.so.1? Also , is it best practice to name your library using 1.0.0 for example, or just 1? g++ ... -Wl,-soname

C++ load shared library and extract class implementations at runtime on linux platform

好久不见. 提交于 2019-12-03 22:14:04
In C++, is it possible to load a shared library at execution time? I want the user to choose which shared library to be loaded at runtime, without recompiling the whole program. dlopen() is a solution for C, but my program is written is C++/Qt, and the symbol to extract are Qt-style class, is there a more "c++" way to do that. You can do it in Qt using QLibrary in two ways. The following example calls a function from a shared library at runtime in two different ways: #include <QLibrary> #include <QDebug> class Dynamic_library { public: Dynamic_library(); virtual int sum( int len, int * data );

How to relink existing shared library with extra object file

旧时模样 提交于 2019-12-03 21:50:34
I have existing Linux shared object file (shared library) which has been stripped. I want to produce a new version of the library with some additional functions included. I had hoped that something like the following would work, but does not: ld -o newlib.so newfuncs.o --whole-archive existinglib.so I do not have the source to the existing library. I could get it but getting a full build environment with the necessary dependencies in place would be a lot of effort for what seems like a simple problem. You might like to try coming at this from a slightly different angle by loading your object

Two library of different versions in an application

↘锁芯ラ 提交于 2019-12-03 21:13:38
Consider a scenario where there are two shared library of different version.Consider A.1.so linked to B.so and A.2.so linked to C.so. Now both B.so and C.so are linked to d.exe . When B.so wants to invoke function in A.1.so, it ends up calling function in A.2.so .Because of this , it gives us undefined behaviour. Now I want my B.so invoke only A.1.so.I can only modify A.1.so and B.so , nothing else. Using dlopen() is one of the option, but for using dlopen() , I have to make heavy changes in B.so. There are many solutions given earlier in Stack Overflow, but nothing seems to work. Kindly note