shared-libraries

Hiding C++ symbols with -fvisibility=hidden [duplicate]

你。 提交于 2020-05-17 06:49:05
问题 This question already has answers here : Hiding instantiated templates in shared library created with g++ (5 answers) Closed 4 days ago . I have a C++ library with a C API, and I have set the -fvisibility=hidden compiler flag, and then I have set __attribute__ ((visibility ("default"))) on C API methods. However, I still see visible C++ symbols. When I create a debian package for my library, I get the following symbols file Why are these symbols still visible ? 回答1: You should run your

Loading two different versions of the same shared library

你说的曾经没有我的故事 提交于 2020-05-16 01:12:53
问题 I'm in a situation that's quite similar to the following. There's libA.so that depending on some compile time flags exhibits slightly different behaviour (it's an external lib, and I can't modify the source). Then, I have libB.so that depends on libA.so (compiled with say -DVALUE=1 ), and in my executable I depend both on libB.so , as well as on libA.so , but compiled with -DVALUE=0 . However, once I launch it, ld resolves all symbols with one of libA.so versions, so both my executable and

Loading two different versions of the same shared library

独自空忆成欢 提交于 2020-05-16 01:08:59
问题 I'm in a situation that's quite similar to the following. There's libA.so that depending on some compile time flags exhibits slightly different behaviour (it's an external lib, and I can't modify the source). Then, I have libB.so that depends on libA.so (compiled with say -DVALUE=1 ), and in my executable I depend both on libB.so , as well as on libA.so , but compiled with -DVALUE=0 . However, once I launch it, ld resolves all symbols with one of libA.so versions, so both my executable and

Loading two different versions of the same shared library

余生颓废 提交于 2020-05-16 01:08:02
问题 I'm in a situation that's quite similar to the following. There's libA.so that depending on some compile time flags exhibits slightly different behaviour (it's an external lib, and I can't modify the source). Then, I have libB.so that depends on libA.so (compiled with say -DVALUE=1 ), and in my executable I depend both on libB.so , as well as on libA.so , but compiled with -DVALUE=0 . However, once I launch it, ld resolves all symbols with one of libA.so versions, so both my executable and

'Failed to load the JNI shared library “C:\Program Files\Java\jre7\bin\client\jvm.dll” '

a 夏天 提交于 2020-05-15 06:42:25
问题 I have looked for a solution, but all the ones I found didn't work. I have triple checked that I have both 64 bit JRE/JDK and Eclipse I have added the '-vm' argument to the eclipse.ini file. Here's the file content: -startup plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835 -product org.eclipse.epp.package.standard.product --launcher.defaultAction openFile --launcher.XXMaxPermSize

How to use android databinding within a library

无人久伴 提交于 2020-05-13 06:08:27
问题 Is it possible to use Android DataBinding within a library project? I did create a library to be used for other people. Within this library I did use Android DataBinding. It did work on the same Android Studio project as a module, but when i install it to my local maven repo it wouldn't compile because of the generated files couldn't be found. As I checked the aar file, i couldn't find the generated databinding folder as well. The following error will be produced: error: cannot access

How can I call linux shared library functions in Go?

冷暖自知 提交于 2020-05-13 04:12:30
问题 I have a .so file whose functions I would like to call in my Go code. How do I go about doing that ? I have read the cgo and syscall package. They are close to what I want but I don't see any place where I can call the functions in the .so file. I want to achieve exactly what the ctypes package does in Python. Can somebody help ? 回答1: If you want to use a shared library that is known statically at compile time, you can simply use cgo. Read the documentation on how to do that exactly, but

How can I call linux shared library functions in Go?

人走茶凉 提交于 2020-05-13 04:12:06
问题 I have a .so file whose functions I would like to call in my Go code. How do I go about doing that ? I have read the cgo and syscall package. They are close to what I want but I don't see any place where I can call the functions in the .so file. I want to achieve exactly what the ctypes package does in Python. Can somebody help ? 回答1: If you want to use a shared library that is known statically at compile time, you can simply use cgo. Read the documentation on how to do that exactly, but

ELF: linking: Why do I get undefined references in .so files

回眸只為那壹抹淺笑 提交于 2020-05-10 04:42:48
问题 I'm trying to build a program against wxWidgets, and I get a linker error. I'd like to really understand what it means. The error is: /usr/lib/libwx_baseu-2.8.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11' What I don't understand is why the error is at libwx_baseu-2.8.so . I thought that .so files had all its symbols resolved, contrary to .o files that still need linking. When I ldd the .so , I get can resolve all its linked libraries, so there is no

ELF: linking: Why do I get undefined references in .so files

心不动则不痛 提交于 2020-05-10 04:42:04
问题 I'm trying to build a program against wxWidgets, and I get a linker error. I'd like to really understand what it means. The error is: /usr/lib/libwx_baseu-2.8.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11' What I don't understand is why the error is at libwx_baseu-2.8.so . I thought that .so files had all its symbols resolved, contrary to .o files that still need linking. When I ldd the .so , I get can resolve all its linked libraries, so there is no