shared-libraries

Why changing LD_LIBRARY_PATH has no effect in Ubuntu?

岁酱吖の 提交于 2020-08-17 05:06:28
问题 I was trying to deploy my application on Ubuntu 16.04 . So i made a package with the following hierarchy - Package | ----bin | -----application -----application.sh -----Qt | -----necessary qt libraries -----platforms Here is the application.sh file - #!/bin/sh export LD_LIBRARY_PATH=`pwd`/Qt ./application When i execute the application.sh file, it shows me that it cant find the libQt5MultimediaWidgets.so.5 file. But its in the Qt folder. Also when i print the ldd application from the

I can call a function imported with dlsym() with a wrong signature, why?

故事扮演 提交于 2020-08-09 09:36:59
问题 host.cpp has: int main (void) { void * th = dlopen("./p1.so", RTLD_LAZY); void * fu = dlsym(th, "fu"); ((void(*)(int, const char*)) fu)(2, "rofl"); return 0; } And p1.cpp has: #include <iostream> extern "C" bool fu (float * lol) { std::cout << "fuuuuuuuu!!!\n"; return true; } (I intentionally left errors checks out) When executing host, “fuuuuuuuu!!!” is printed correctly, even though I typecasted the void pointer to the symbol with a completely different function signature. Why did this

How to generate a .so file from multiple source files

丶灬走出姿态 提交于 2020-08-05 09:37:53
问题 I have been trying from the past few days for generating a shared library. I have header files, source files and asm files as well. I have tried to follow quiet a number of similar questions but I was not able to locate one that specifies the steps needed to generate a .so file from multiple source, header and asm files. I have been facing many issues for generating the .so file. If someone could help me with the step by step procedure for generating a .so file, I would be very grateful. Also

How to generate a .so file from multiple source files

断了今生、忘了曾经 提交于 2020-08-05 09:35:28
问题 I have been trying from the past few days for generating a shared library. I have header files, source files and asm files as well. I have tried to follow quiet a number of similar questions but I was not able to locate one that specifies the steps needed to generate a .so file from multiple source, header and asm files. I have been facing many issues for generating the .so file. If someone could help me with the step by step procedure for generating a .so file, I would be very grateful. Also

How to generate a .so file from multiple source files

北城余情 提交于 2020-08-05 09:34:21
问题 I have been trying from the past few days for generating a shared library. I have header files, source files and asm files as well. I have tried to follow quiet a number of similar questions but I was not able to locate one that specifies the steps needed to generate a .so file from multiple source, header and asm files. I have been facing many issues for generating the .so file. If someone could help me with the step by step procedure for generating a .so file, I would be very grateful. Also

Loading shared library twice

倖福魔咒の 提交于 2020-07-21 06:15:28
问题 I'm trying to load a shared library in C twice: lib1 = dlopen("mylib.so", RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND); lib2 = dlopen("mylib.so", RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND); What I want is that lib1 and lib2 have separate address spaces so that they can do different things. Currently, the only way I can achieve this is by copying mylib so that the code looks like this: lib1 = dlopen("mylib.so", RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND); lib2 = dlopen("mylib2.so", RTLD_LAZY | RTLD_LOCAL

How to specify the output directory of a given DLL?

安稳与你 提交于 2020-07-16 08:26:52
问题 I'm using the following src/CMakeLists.txt : cmake_minimum_required(VERSION 3.1.0) project(foo) add_library(foo SHARED foo.cpp) set_target_properties(foo PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<CONFIG>/subdir ) And on Windows, I'm building the library using: mkdir build cd build cmake ../src cmake --build . Output File: ~/build/Debug/foo.dll Expected Output File: ~/build/Debug/subdir/foo.dll What am I doing wrong? It works fine on platforms other than Windows, and it seems

Maven dependency incompatible library class

…衆ロ難τιáo~ 提交于 2020-07-09 17:46:51
问题 My application is defined with an external library jar dependency <dependency> <groupId>com.lib</groupId> <artifactId>Encoder</artifactId> </dependency> It has two versions 1.0 and 2.0. A class owned in the library got updated in its package structure between these versions as below. 1.0 -- a.b.c.Template 2.0 -- x.y.z.Template Another dependency called 'Helper' used in my application also contains the above stated Encoder library, but with version 1.0. Now, my application is defined with

Maven dependency incompatible library class

天涯浪子 提交于 2020-07-09 17:46:28
问题 My application is defined with an external library jar dependency <dependency> <groupId>com.lib</groupId> <artifactId>Encoder</artifactId> </dependency> It has two versions 1.0 and 2.0. A class owned in the library got updated in its package structure between these versions as below. 1.0 -- a.b.c.Template 2.0 -- x.y.z.Template Another dependency called 'Helper' used in my application also contains the above stated Encoder library, but with version 1.0. Now, my application is defined with

How to fix 'Could not load the Qt platform plugin “xcb” in “” even though it was found.' after fixup_bundle macro?

断了今生、忘了曾经 提交于 2020-07-08 11:48:12
问题 I'm trying to setting up a standalone binary archive (.tar.gz) that can run on most Linux distros (ex. Blender). I'm still not familiar with CMake. As far as I know, all the dependencies can be resolved at the install step with fixup_bundle macro. And I assume that the install directory should become a standalone app that can be copied and run on other computers without Qt installed? I'm not sure about the role of CPack here. What I've tried My Qt installation path is /home/<user>/Qt5.12.2/5