shared-libraries

Accessing .so libraries using dlopen() throws undefined symbol error

北城余情 提交于 2019-12-03 02:43:24
I'm trying to dynamically load a camera library .so file into a Linux executable to gain access to simple camera functions. I'm attempting to do this by: if ( (newHandle = dlopen("./libCamera.so",RTLD_LAZY | RTLD_GLOBAL)) == NULL ) { printf( "Could not open file : %s\n", dlerror() ); return 1; } However this fails and I receive the following output: "Could not open file : libCamera.so: undefined symbol: ZTVN10 _cxxabiv117__class_type_infoE" How do I find out what symbols it is relying on? Most likely, libCamera.so uses a symbol defined in a shared library without depending on that library.

Shared library in Go?

岁酱吖の 提交于 2019-12-03 02:42:46
问题 Is it possible to create a Shared Library (.so) using Go? UPDATED : created an "issue" for it. 回答1: This is possible now using -linkshared flag What you need to do is to first run this command: go install -buildmode=shared -linkshared std (Above code makes all common packages shareable!) then go install -buildmode=shared -linkshared userownpackage finally when compiling your code you need to run: go build -linkshared yourprogram What the above those is now it rather than statically linking

Relation between object file and shared object file

落爺英雄遲暮 提交于 2019-12-03 02:32:55
问题 what is the relation between shared object( .so ) file and object( .o ) file? can you please explain via example? 回答1: Let's say you have the following C source file, call it name.c #include <stdio.h> #include <stdlib.h> void print_name(const char * name) { printf("My name is %s\n", name); } When you compile it, with cc name.c you generate name.o . The .o contains the compiled code and data for all functions and variables defined in name.c, as well as index associated their names with the

How do I source/link external functions in C or C++?

亡梦爱人 提交于 2019-12-03 00:48:31
EDIT: I suppose I should clarify, in case it matters. I am on a AIX Unix box, so I am using VAC compilers - no gnu compilers. End edit I am pretty rusty in C/C++, so forgive me if this is a simple question. I would like to take common functions out of a few of my C programs and put them in shared libraries or shared objects. If I was doing this in perl I would put my subs in a perl module and use that module when needed. For the sake of an example, let's say I have this function: int giveInteger() { return 1034; } Obviously this is not a real world example, but if I wanted to share that

Linking with versioned shared library in Android NDK

℡╲_俬逩灬. 提交于 2019-12-03 00:34:41
I am trying to load two shared libraries in my Android application through the loadLibrary call: System.loadLibrary("mywrapper"); System.loadLibrary("crypto"); I keep running catching the `UnsatisfiedLinkError. Here is a more detailed version of the error. Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1969]: 130 could not load needed library 'libcrypto.so.1.0.0' for 'libmywrapper.so' (load_library[1111]: Library 'libcrypto.so.1.0.0' not found) Any ideas? After spending some time I found out that Android doesn't support versioned libraries. Has any one faced the

gcc debug symbols (-g flag) vs linker's -rdynamic option

天涯浪子 提交于 2019-12-03 00:33:42
问题 glibc provides backtrace() and backtrace_symbols() to get the stack trace of a running program. But for this to work the program has to be built with linker's -rdynamic flag. What is the difference between -g flag passed to gcc vs linker's -rdynamic flag ? For a sample code I did readelf to compare the outputs. -rdynamic seems to produce more info under Symbol table '.dynsym' But I am not quite sure what the additional info is. Even if I strip a program binary built using -rdynamic ,

Load Jenkins Pipeline Shared Library from same repository

纵然是瞬间 提交于 2019-12-02 23:50:18
TL;DR Is there a way to import code into the Jenkinsfile from the local repository (other than the load step)? Why? I've experienced that for complex builds the Jenkinsfile gets kind of bulky and not very maintainable. Now that the build job is code, it would be wonderful to have the same means as for other code. That is, I would like to divide it into smaller (more maintainable) units and unit test them. What I tried shared libraries : allow for dividing our Jenkins Pipeline logic into smaller files in a separate module and even unit test it. However, they need to be in different repository

how to deal with shared-libraries for many web applications using the same libraries

随声附和 提交于 2019-12-02 23:30:00
We have a web application made in Java, which uses struts2, spring and JasperReport. This application runs on glassfish 4.0. The libraries of the application are in the WEB-INF/lib folder, and also in glassfish are installed 4 more than uses the same libraries. Glassfish is configured to use 1024mb for heapspace and 512m for permgen, and the most of the memory consumption when i use libraries per application is in the struts actions and spring aop classes (using netbeans profiler). The problem we are having is the amount of memory consumed by having libraries in the classloader per application

replace a dynamic shared library in run time

点点圈 提交于 2019-12-02 23:08:25
I need to use different dynamic library over a execution cycle of a program. Looking at dlfcn.h I thought this was possible. I confess of not reading much literature on dynamic library loading. OK here is what I do - I have created shared library called `libdynamicTest.so.1` The main APP opens this solib ( dlopen ), gets the function pointer ( dlsym ), run it and then close it back ( dlclose ) Everything is fine until here. Now suppose I replace my libdynamicTest.so.1 by another libdynamicTest.so.1 (some code diff) I see a Segmentation fault. Further I have made sure the solib is replaced

How to make sure the numpy BLAS libraries are available as dynamically-loadable libraries?

一个人想着一个人 提交于 2019-12-02 22:13:03
The theano installation documentation states, that theano will as a default use the BLAS libraries from numpy, if the "BLAS libraries are available as dynamically-loadable libraries". This seems not to be working on my machine, see error message. How do I find out, if the numpy BLAS libraries are availalbe as dynamically-loadable? How do I recompile the numpy BLAS libraries, if they are not dynamically-loadable? Please indicate, if you would need more information! Error message We did not found a dynamic library into the library_dir of the library we use for blas. If you use ATLAS, make sure