shared-libraries

gcc: Not able to create .so from object files

青春壹個敷衍的年華 提交于 2019-12-11 16:54:42
问题 I am trying to create .so dynamic library from *.o files and facing below issue. LOG: [nptemp-static]$ gcc -shared *.o -o libexample.so /usr/bin/ld: bindings_hubbub_parser.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC bindings_hubbub_parser.o: could not read symbols: Bad value collect2: ld returned 1 exit status Any idea? Do I need to recompile my whole source code with the option specified? Actually, I am not aware of the

How to build and use GoogleTest shared library (.so) using g++ on Linux?

随声附和 提交于 2019-12-11 16:54:30
问题 NOTE it's not a duplicate of this question or this question. How to build Googletest from source using g++ into a shared library (.so)? I tried the steps described in Google Test's document on how to build a shared library, but linking the produced libgtest.so with my test programs didn't work - the linker throws tons of errors like: "gtest-all.cc:(.text+0x19b50): multiple definition of `testing::internal::HasNewFatalFailureHelper::~HasNewFatalFailureHelper()'libgtest.so:gtest-all.cc:(.text

C pluginsystem: symbol lookup error

雨燕双飞 提交于 2019-12-11 16:53:55
问题 I am writing a plugin system which is separated other 3 modules: plugin_system.c - the core of the system list.c - contains a linked list implementation for plugins' storage plugin_interface.h - contains the declaration needed by plugins, has no source file associated with plugin_interface.h only contains only of types and the function: extern int plugin_register(PluginManager *plug_manager, const char *name, Plugin *plug); which is defined in plugin_system.c When loading a plugin, the plugin

JEE shared library in WebLogic

…衆ロ難τιáo~ 提交于 2019-12-11 16:50:04
问题 I am porting my application to WebLogic as an Enterprise Library so that my EJB and MDB can invoke code in it. I have chosen a EAR packaging for both say Lib1.ear and Lib2.ear which contains APP-INF/lib directory and have 100's of jars in both. I also have updated the MANIFEST.MF of both to contains Specification-Version and Implementation-Version . Both are deployed successfully and available to be used. Now I updated my ear which contains my EJB and MDB and added following in weblogic

Scipy / ctypes build-config: How to load lib?

北城余情 提交于 2019-12-11 15:53:15
问题 These docs have a nice example on how to compile some external C/C++ code and load this using ctypes. This works great with manual compilation (where i'm controlling the names of my library which later gets loaded). Now how to prepare some code to be used within scipy with full incorporation into scipy's build-system? A more general github-issue does not provide the information i'm looking for (and sadly, there is not much action). Also: i'm more interested in using ctypes (no real usage

Error 'loading android-aarch64/libmongo_embedded_capi.so' for MongoDB Mobile

半腔热情 提交于 2019-12-11 13:24:26
问题 I'm trying to use MongoDB Mobile (beta) in my Android app. I've folowed the steps as described here This is the code that is executed: final StitchAppClient client = Stitch.initializeDefaultAppClient("<APP ID>"); final MongoClient mobileClient = client.getServiceClient(LocalMongoDbService.clientFactory); the first line works but when the second line is executed the app crashes with this error: com.mongodb.embedded.client.MongoClientEmbeddedException: Failed to load the mongodb library: 'mongo

Building SMTP client for Qt for Android target

时光总嘲笑我的痴心妄想 提交于 2019-12-11 13:11:41
问题 I am using the SMTP Client project to create a library file (.dll) on Windows. Everything works fine and e-mails are sent successfully. I want to port my Qt project to Android and since Android is a different architecture I need to build the library using a Android armv7 toolkit. I try this, but I get error: Internal Error: Unknown Android deployment JSON file location. Error while building/deploying project SMTPEmail (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.2)) When executing step

warning: cannot find entry symbol _start - while compiling to .so

独自空忆成欢 提交于 2019-12-11 12:05:27
问题 Hello I am running Linux Ubuntu and am compiling using icpc (intel compiler), I want to get a shared library so I used the command: icpc -o myShared.so -std=c++11 -shared -DSTDC_HEADERS -D __cplusplus=201103L -fpermissive -DPT_XX_DEV -fexceptions -frtti -DANDROID -w -fstack-protector -fPIE -fPIC -pie -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -I/home/admins/aaa/include -I/home/admins/bbb/include a.cpp b.cpp c.cpp -lpthread -L./../../static_libs -lmyStatic I an getting a warning: ld:

Remove embedded source filenames from shared libraries

江枫思渺然 提交于 2019-12-11 11:46:50
问题 When I build a shared library "mylib.so" from a source file "secret.cc", the resulting shared object contains the source filename: ... do_global_ctors_aux^@secret.cc^@__DTOR_END ... But I don't want to divulge the name of that file ("secret.cc") to the users of my library. Is there a way to strip the filename information from the shared object, or to prevent it from being inserted in the first place? 回答1: It's quite simple: Don't let the compiler know the source's filename from the very

How to compile gcc with shared library?

梦想的初衷 提交于 2019-12-11 11:13:47
问题 I create shared library libpl.so . I use this command to create connections: ln -s libpl.so.1.0.1 libpl.so.1 ln -s libpl.so.1.0.1 libpl.so And now I try to compile my program using: gcc main.c -o main -L. -libpl but I have erros: /usr/bin/ld: cannot find -libpl collect2: error: ld returned 1 exit status What should I do to fix it ? How compile it ? 回答1: This line should help: export LD_LIBRARY_PATH=/path/to/libpl.so:$LD_LIBRARY_PATH You should follow this tutorial on shared libraries on linux