shared-libraries

Cannot open shared object file: No such file or directory; Running or Debugging in Eclipse

帅比萌擦擦* 提交于 2019-12-30 04:11:09
问题 On Ubuntu, I have a C++ app in Eclipse. The application compiles fine and I can run the app from the command line. But when I try to debug it or run it with Eclipse, the error : "Cannot open shared object file: No such file or directory" is thrown on a shared library. I've set LD_LIBRARY_PATH in my bashrc file and also set an LD_LIBRARY_PATH environment variable in both the Run Configuration and Debug Configuration to : /home/behlingb/Documents/api_libs/FileGDB_API/lib What else am I missing

How to create a shared object file from static library

佐手、 提交于 2019-12-30 03:04:04
问题 How to create a shared object file from a static library? I am using Cygwin. Is the following syntax correct? gcc -shared -o libexample.so libexample.a 回答1: gcc -shared -o libexample.so -Wl,--whole-archive libexample.a Pay attention that often you'll want the objects combined in your .so to be compiled as PIC, something you don't often want for a static library. 回答2: It might not work but you can always try: ar -x libexample.a gcc -shared *.o -o libexample.so If it complains about -fPIC, then

Is there any way to change the SONAME of a binary directly?

荒凉一梦 提交于 2019-12-30 02:10:40
问题 My program depends on libcurl.so.3 , but in RHEL6 there is no symbolic link libcurl.so.3 ⇾ libcurl.so.4 (my program can run smoothly when I create this link). However, there is symbolic link libcurl.so ⇾ libcurl.so.4 . I would like to modify the SONAME embedded in libcurl.so.3.0.0.0 file from libcurl.so.3 to libcurl.so so that I could run my program on RHEL 6 without creating a symbolic link. My solution could not be optimal but I think learning how to modify the binary directly is valuable.

Is there any way to change the SONAME of a binary directly?

烂漫一生 提交于 2019-12-30 02:10:25
问题 My program depends on libcurl.so.3 , but in RHEL6 there is no symbolic link libcurl.so.3 ⇾ libcurl.so.4 (my program can run smoothly when I create this link). However, there is symbolic link libcurl.so ⇾ libcurl.so.4 . I would like to modify the SONAME embedded in libcurl.so.3.0.0.0 file from libcurl.so.3 to libcurl.so so that I could run my program on RHEL 6 without creating a symbolic link. My solution could not be optimal but I think learning how to modify the binary directly is valuable.

list exported functions from dll with ctypes

隐身守侯 提交于 2019-12-30 00:31:26
问题 Is there any way to know which functions are exported from the dll through python foreign function library ctypes ? And if possible to know details about the exported functions through c types . If yes, could someone provide a snippet of code? 回答1: I don't think ctypes offers this functionality. On Windows with visual studio: DUMPBIN -EXPORTS XXX.DLL Or for mingw on windows: objdump -p XXX.dll 回答2: If you are on Linux, there is a handy utility nm to list the content of a shared library (there

Is $CATALINA_HOME/shared/lib a real feature in Tomcat?

血红的双手。 提交于 2019-12-29 08:19:12
问题 In Apache Tomcat, I have seen some posts that refer to the path $CATALINA_HOME/shared/lib . When I download Tomcat, I see no shared folder nested in the Tomcat home folder. I do see a $CATALINA_HOME/lib path, a lib folder nested in the Tomcat home folder. I understand this is the proper place for JAR files that should not be copied across "contexts" (web apps) in Tomcat. JDBC drivers are one important example of such. The problem is that Tomcat populates that $CATALINA_HOME/lib folder with

Is $CATALINA_HOME/shared/lib a real feature in Tomcat?

╄→尐↘猪︶ㄣ 提交于 2019-12-29 08:19:08
问题 In Apache Tomcat, I have seen some posts that refer to the path $CATALINA_HOME/shared/lib . When I download Tomcat, I see no shared folder nested in the Tomcat home folder. I do see a $CATALINA_HOME/lib path, a lib folder nested in the Tomcat home folder. I understand this is the proper place for JAR files that should not be copied across "contexts" (web apps) in Tomcat. JDBC drivers are one important example of such. The problem is that Tomcat populates that $CATALINA_HOME/lib folder with

how to pass argument to constructor on library load?

杀马特。学长 韩版系。学妹 提交于 2019-12-29 07:20:37
问题 I am trying to create a shared library in Linux. How can I pass an argument to function my_load() when library is loaded? In my C application, I make a call to test_func() then it automatically executes my_load() first before the called function then lastly it executes my_unload() #include <stdio.h> void __attribute__ ((constructor)) my_load(int argc, char *argv[]); void __attribute__ ((destructor)) my_unload(void); void test_func(void); void my_load(int argc, char *argv[]) { printf("my_load:

how to pass argument to constructor on library load?

若如初见. 提交于 2019-12-29 07:20:21
问题 I am trying to create a shared library in Linux. How can I pass an argument to function my_load() when library is loaded? In my C application, I make a call to test_func() then it automatically executes my_load() first before the called function then lastly it executes my_unload() #include <stdio.h> void __attribute__ ((constructor)) my_load(int argc, char *argv[]); void __attribute__ ((destructor)) my_unload(void); void test_func(void); void my_load(int argc, char *argv[]) { printf("my_load:

How to export symbols from a shared library

自作多情 提交于 2019-12-29 06:24:10
问题 I created a shared library ( *.so ) using the *.o object code files (C source code) using RVDS compiler on Windows Host. I link this shared object with a application (using gcc for ARM target on Linux host) and obtain a executable, which on running generates segmentation fault. (I know I have to debug it!) Instead of creating shared library, if I create a static library with same source files, and then link with the application, and then execute the application it works fine as expected. So