shared-libraries

A question on shared library and thread specific data

强颜欢笑 提交于 2019-12-24 03:06:16
问题 This question is in reference to gdb and valgrind within a makefile. I found the reason of segmentation fault as pointed out in the previous quetion and I now don't know how to solve the issue. I am sorry i shall not be able to post the code as it spreads across multiple files and hence tends to be quite huge. looking at the Makefile all: clients.so simulator backup LD_PRELOAD=/home/Juggler/client/clients.so ./simulator backup: backup.c libclient.a gcc backup.c -o backup -L /home/Juggler

Error: ‘void*’ is not a pointer-to-object type

只愿长相守 提交于 2019-12-24 02:56:45
问题 I'm trying to access function from dynamic library, that instantiates an instance of Person, and returns pointer to it as void pointer. The program then has to cast the void pointer to a Person, using a reinterpret_cast. But, I'm getting an error: error: ‘void*’ is not a pointer-to-object type. Here is the code: function from library: void* loadPerson (void) { return reinterpret_cast<void*>(new Person); } main.cpp: void* loadPerson = dlsym(lib_handle, "loadPerson"); void* person_vp = (

Shared libraries C++ Makefile

浪子不回头ぞ 提交于 2019-12-24 02:27:30
问题 I need to compile fat binary file to be able use it on another linux machine. But there are some libraries missing so as I understand I should compile it with some -shared options. But I don't understand how to configure a Makefile for that. Currently my makefile looks like this: CC = g++ CC_FLAGS = -std=c++11 -O2 -static -Wall EXEC = cpp_server SOURCES = $(wildcard *.cpp) OBJECTS = $(SOURCES:.cpp=.o) LIBS = -lpthread -lmicrohttpd -lz $(EXEC): $(OBJECTS) $(CC) $(OBJECTS) -o $(EXEC) $(LIBS) %

Adding Documentation of a library to manual pages

杀马特。学长 韩版系。学妹 提交于 2019-12-24 01:59:11
问题 I am working with Ubuntu 12.04.1 . I am learning to make a basic video player using FFmpeg library in C . My manual pages don't show any entries for the headers/functions of the library . Can someone please show me a way to add the documentation to my manual pages . It is much easy to search that way than searching on a web page everytime . PS : I have tried to add documentation to man pages using Synaptic package manager . I installed a ffmpeg-doc package . But it doesn't seem to work .

What's the purpose of the lua “stub” dll for windows

房东的猫 提交于 2019-12-24 01:54:18
问题 I'm looking at incorporating Lua into a C++ project, and am a bit confused by the presence of the two binaries (lua51.dll and lua5.1.dll) in the distribution from Luabinaries. According to the docs... In Windows your library or application must be linked with a stub library. A stub library is a library with only the function declarations that will bind your DLL with the Lua DLL. Why? I've never needed stub DLLs before when linking with third-party DLLs? 回答1: A stub library is a .lib file, not

incorporate .so into another .so without dependency?

三世轮回 提交于 2019-12-24 01:41:15
问题 i have a c program that relies on a second library whose compilation i can control. i want to be able to compile my program into a shared object library without it linking to the second library. in other words i want a single monolithic shared object library at the end. how can i do this? if i separately compile the second library into a .so and include that as a dependency when compiling my program, i can see that i need that file when i run ldd on the binary. 回答1: You need to compile your

Using custom dll in Qt Application

牧云@^-^@ 提交于 2019-12-24 01:16:33
问题 First, my compiler and OS: Qt Creator 1.3 Qt 4.6 (32 bit) Windows 7 Ultimate I want to learn how to create and import a dll in Qt. I've created a *.dll file using Qt Creator, called Shared1.dll which contains nothing but an empty class named Shared1 . Now I'd like to use Shared1 class in another Qt project. How can I do that? Thanks in advance. 回答1: Use your Pro file to include your header files and libraries.. For Header Files: INCLUDEPATH += "C:\Source\HeaderFiles" For libraries: LIBS += "C

Why does the same executable use different RUNPATHs for different library lookups?

荒凉一梦 提交于 2019-12-24 00:29:13
问题 I have a Linux C++ program that builds & links (with -Wl,--no-undefined , no less) but fails to load all of its libraries when I try to run it. I've been trying to inspect its dependencies with ldd , but I can't figure out why it's tripping over the library that's failing: $ ldd standalone_test ... lots of libraries that are found ... libPythia6.so => not found Now, this library is in a place where it ought to be found according to the RUNPATH embedded in the executable: $ readelf -d .

Missing frames on shared libraries on ARM

十年热恋 提交于 2019-12-24 00:05:00
问题 I'm currently working on a debugging environment, and I'm have trouble creating valid core files on ARM where the crash that caused a segmentation fault occurred on shared library code. It seems that when there's a call to a function in a shared library, the frame pointer gets lost. I've checked all the gcc flags I could think of. I'm not using any optimizations, not using -fomit-frame-pointer and I've tried using -rdynamic, all without success. Also, I'm not using abort(), since I read it is

GCC and ld can't find exported symbols…but they're there

微笑、不失礼 提交于 2019-12-23 23:07:39
问题 I have a C++ library and a C++ application trying to use functions and classes exported from the library. The library builds fine and the application compiles but fails to link. The errors I get follow this form: app-source-file.cpp:(.text+0x2fdb): undefined reference to `lib-namespace::GetStatusStr(int)' Classes in the library seem to be resolved just fine by the linker, but free functions and exported data (like a cosine lookup table) invariably result in the above error. I am using Ubuntu