shared-libraries

Could not load the Qt platform plugin “xcb” in “” even though it was found

萝らか妹 提交于 2020-12-10 09:29:23
问题 This question is asked several times in Stack Overflow. I tried methods in several discussions but it didn't work. So my OpenCV library which was built with custom Qt doesn't work properly: import cv2 img = cv2.imread("IMAGE_PATH") cv2.imshow("frame", img) qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available

Could not load the Qt platform plugin “xcb” in “” even though it was found

橙三吉。 提交于 2020-12-10 09:28:28
问题 This question is asked several times in Stack Overflow. I tried methods in several discussions but it didn't work. So my OpenCV library which was built with custom Qt doesn't work properly: import cv2 img = cv2.imread("IMAGE_PATH") cv2.imshow("frame", img) qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available

Convert .a to .dylib in Mac osx

旧城冷巷雨未停 提交于 2020-12-08 07:09:29
问题 Is it possible to convert .a files to .dylib files in Mac osx? I currently have libraryname.a and it can't seem to include it in my program as only .dylib libraries are included. Is there also a command that shows static libraries used in a program via mac osx terminal? 回答1: Yes, this is possible. To convert foo.a into libfoo.dylib , try this command: clang -fpic -shared -Wl,-all_load foo.a -o libfoo.dylib On Linux, here's the equivalent command using gcc : gcc -fpic -shared -Wl,-whole

Loading executable or executing a library

戏子无情 提交于 2020-12-06 12:25:06
问题 There is a large number of questions on SO about how to execute a library or dynamically load an executable. As far as I can tell, all the answers come down to: compile your executable as position-independent code and load it with dlopen . This worked great --- and still works great on macOS --- until a recent change in glibc, which explicitly disabled dlopen ing PIEs. This change is now in the current version of glibc (2.30) on ArchLinux, for example, and trying to dlopen a position

“Undefined reference ” to a function defined in static library

喜你入骨 提交于 2020-12-05 09:22:13
问题 I am trying to build a Library to use in an application. I built the library as below, and when i compile the application i get the below error: I have done the beolw things. I use: gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) In Library to be called from application: Here i have lot of modules, but entry point to this library is func() (i.e., main () is replaced with func() so that i can call the module, also func () is not declared as 'static'.) In one of files: int func (); ... int

“Undefined reference ” to a function defined in static library

与世无争的帅哥 提交于 2020-12-05 09:21:09
问题 I am trying to build a Library to use in an application. I built the library as below, and when i compile the application i get the below error: I have done the beolw things. I use: gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) In Library to be called from application: Here i have lot of modules, but entry point to this library is func() (i.e., main () is replaced with func() so that i can call the module, also func () is not declared as 'static'.) In one of files: int func (); ... int

How to rename a shared library to avoid same-name conflict?

ⅰ亾dé卋堺 提交于 2020-12-03 11:54:55
问题 I found a library, libjson, that I am trying to build as a shared library and use in a project. Building is simple enough; after fixing a Makefile bug, # SHARED=1 make install will compile and install a .so in /usr/lib . The problem is that my system (Arch Linux) already has a library named libjson , which the Makefile thoughtlessly overwrites for me! Arch's library was installed as a dependency, so it can't be replaced. Presumably other distros would have a similar problem if they had a

How to rename a shared library to avoid same-name conflict?

微笑、不失礼 提交于 2020-12-03 11:51:05
问题 I found a library, libjson, that I am trying to build as a shared library and use in a project. Building is simple enough; after fixing a Makefile bug, # SHARED=1 make install will compile and install a .so in /usr/lib . The problem is that my system (Arch Linux) already has a library named libjson , which the Makefile thoughtlessly overwrites for me! Arch's library was installed as a dependency, so it can't be replaced. Presumably other distros would have a similar problem if they had a

Is there a way to determine thread local storage model used by a library on Linux

筅森魡賤 提交于 2020-12-02 07:22:52
问题 Is there a way to query the TLS model of a shared library on Linux? (eg using ldd or some other tool). I am having a trouble with loading too many libraries with the "initial-exec" model and would like to determine for sure which of the third party libs use this model (so I can free up some slots eg by linking statically). This results in an error: dlopen: cannot load any more object with static TLS see this question. 回答1: I ran into this error myself, and while investigating it, I came on a

Is there a way to determine thread local storage model used by a library on Linux

こ雲淡風輕ζ 提交于 2020-12-02 07:22:29
问题 Is there a way to query the TLS model of a shared library on Linux? (eg using ldd or some other tool). I am having a trouble with loading too many libraries with the "initial-exec" model and would like to determine for sure which of the third party libs use this model (so I can free up some slots eg by linking statically). This results in an error: dlopen: cannot load any more object with static TLS see this question. 回答1: I ran into this error myself, and while investigating it, I came on a