shared-libraries

Hide symbol(s) in Shared Object from LD

99封情书 提交于 2020-01-01 05:05:29
问题 I have two third-party libraries occasionally having the same symbol name exported. When the executable is loaded, ld usually picks the wrong one and I getting crash as a result. I cannot do too much about the content of these libraries, so may be there is a way to instruct ld how to find the proper imlementation ? OS - Solaris 10, my program is built by autoconf/autotools/gcc, conflicting libraries are libclntsh (part of Oracle driver) and OpenLDAP. Unfortuinately, I cannot use Oracle's

shared library constructor not working

痴心易碎 提交于 2020-01-01 04:34:07
问题 In my shared library I have to do certain initialization at the load time. If I define the function with the GCC attribute __attribute__ ((constructor)) it doesn't work, i.e. it doesn't get called when the program linking my shared library is loaded. If I change the function name to _init() , it works. Apparently the usage of _init() and _fini() functions are not recommended now. Any idea why __attribute__ ((constructor)) wouldn't work? This is with Linux 2.6.9, gcc version 3.4.6 Edit: For

Android, Best way to provide app specific constants in a library project?

喜你入骨 提交于 2020-01-01 04:31:05
问题 I am creating a library project for a number of android apps. The apps all have some common functionality that I wish to include in the library project but the library project functions require use of application specific constants So I am looking for a way to provide the library functions with the names of the constants and allow each app to define them An example of a specific app constant and how it is used within the library project public class AppConstants { public static final long APP

Compile Python 2.7.3 from source on a system with Python 2.7 already

北城余情 提交于 2020-01-01 02:53:09
问题 I wish to compile Python 2.7.3 from source. The OS is OpenSUSE 11.4 x86_64, which already provides Python 2.7. I'd like to use 2.7.3 for the latest security patches, but it's a shared system so I can't tinker with the system Python interpreter. I compile using ./configure --prefix=/opt/python --enable-shared . No configure errors, so I make . Again no errors. I do a make install (I don't think I need make altinstall , since this installation prefix in /opt/python isn't in use yet). When I try

/usr/bin/ld: cannot find

落花浮王杯 提交于 2020-01-01 01:25:10
问题 I created a .so file and put it in the location /opt/lib and added this path to LD_LIBRARY_PATH now after this when I try to compile my main program with the following command: g++ -Wall -I/home/alwin/Development/Calculator/ main.cpp -lcalc -o calculator I get the following error: /usr/bin/ld: cannot find -lcalc collect2: ld returned 1 exit status Can someone help me with this. I created the shared library using the code blocks IDE 回答1: Add -L/opt/lib to your compiler parameters, this makes

Shared Libraries: Windows vs Linux method

心已入冬 提交于 2019-12-31 09:15:53
问题 I have a quick question about Windows shared libraries (DLLs) vs Linux shared libraries (SOs). Why is it that when you create a Windows DLL it requires the client program to also link against a static library (.lib file), but applications created in Linux does not require any linking against such static library. Does it have anything to do with code relocation and the like? Thanks. 回答1: Not actually with code relocation, that's a totally different issue. It is about a difference in

Why can't CUDA's examples makefile find the CUDA libraries?

女生的网名这么多〃 提交于 2019-12-31 03:36:06
问题 I'm running Arch Linux and have installed the cuda-sdk and cuda-toolkit from the repositories. I've compiled the libraries inside /opt/cuda-sdk/CUDALibraries fine. No I go to compile the sdk examples by running make in /opt/cuda-sdk/C and get the following error: # make make[1]: Entering directory `/opt/cuda-sdk/C/common' make[1]: Leaving directory `/opt/cuda-sdk/C/common' make[1]: Entering directory `/opt/cuda-sdk/C/common' make[1]: Leaving directory `/opt/cuda-sdk/C/common' make[1]:

ASP.NET Website's BIN directory and references

不打扰是莪最后的温柔 提交于 2019-12-31 02:23:20
问题 Imagine the following solution: Website ABC.com (not Web Application) BLL (business logic layer in a seperate assembly) DTO (dto objects in their own assembly) DAL (data access layer in it's own assembly as well). The BLL has a reference to the DAL. The BLL has a reference to the DTO layer. The Website project references the BLL. When one compiles the website project, the following DLLs will appear in the BIN directory: BLL.dll DTO.dll DAL.dll When one goes to preview the site, an error

Cant use shared libraries in Qt project

南笙酒味 提交于 2019-12-30 22:45:07
问题 I created a C++ library project in Qt creator. After building the project I have the libMylib.so, .so.1, .so.1.0, .so.1.0.0, Makefile and mylib.o files. I added the library headers to my other project and added the path to my .pro file like this: LIBS += "/home/peter/Workspace/build-Libtester-Desktop-Release/libMyLib.so" When building the application I don't get no such file error, but when running it I get this: /home/peter/Workspace/build-Libtester-Desktop-Debug/Libtester: error while

Linking dependencies of a shared library

百般思念 提交于 2019-12-30 20:31:46
问题 I was working with SFML, I compiled a little test program and added the linkage option -lsfml-audio . Then, I used ldd ./program to see the dynamic libraries it was linking to. Surprisingly, there were a lot, none of them had I manually selected in my makefile, nor using pkg-config --libs . I started reading about shared libraries, and made a little example to solve my doubts. However, I have this question: why some libraries need you to add the dependencies in your makefile (either manually