shared-libraries

Boost libs building - difference between runtime-link and link options

一个人想着一个人 提交于 2019-12-20 10:27:27
问题 I'm trying to build boost libraries in Windows 7 with MSVC (VS 2010). I have come across the options runtime-link and link in the bjam command line options. I would like to know how they are used and what is the exact difference between them. I have built the Boost Regex library using this command line bjam --with-regex variant=release --build-options=complete it produced these files: 1)boost_regex-vc100-mt-1_47.dll (Import library:boost_regex-vc100-mt-1_47.lib) 2)libboost_regex-vc100-mt-1_47

Android NDK/JNI: Building a shared library that depends on other shared libraries

雨燕双飞 提交于 2019-12-20 09:37:32
问题 I am writing an android app that wants to make JNI calls into a shared library built in using the NDK. The trick is this shared library calls functions provided by OTHER shared libraries. The other shared libraries are C libraries that have been compiled elsewhere. Here's what I've tried: My Environment: I'm working in Eclipse. I've added native support and have a jni library. In that library I have my code and a \lib directory where I have copied my other .so files. Attempt #1 Android.mk:

What is armeabi and why they use it?

泄露秘密 提交于 2019-12-20 08:56:15
问题 I see this library (armeabi) many times when I explore open sources. I net searched for an explanation of it, but all the results I found are talking ABOUT it and not defining it. What is this armeabi and why are they using it in Android applications? 回答1: Android devices have CPUs. Many of those CPUs are based on the ARM architecture, while some are based on x86, and a few others are based on other stuff like MIPS. Some Android apps use the Native Development Kit (NDK) to create C/C++ code

Creating a simple Makefile to build a shared library

五迷三道 提交于 2019-12-20 08:49:08
问题 I am trying to create a very basic hand crafted Makefile to create a shared library to illustrate a point. This is what I have so far: SHELL = /bin/sh CC = gcc FLAGS = -std=gnu99 -Iinclude CFLAGS = -fPIC -pedantic -Wall -Wextra -march=native -ggdb3 DEBUGFLAGS = -O0 -D _DEBUG RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program TARGET = example.so SOURCES = $(shell echo src/*.c) HEADERS = $(shell echo include/*.h) OBJECTS = $(SOURCES:.c=.o) PREFIX = $(DESTDIR)/usr/local BINDIR = $(PREFIX)/bin

How do I find out which functions of a shared object are used by a program or an other library?

给你一囗甜甜゛ 提交于 2019-12-20 08:40:05
问题 How do I find out which functions of a shared object are used by a program or an other library? In this specific case, I would like to see which functions in /lib/libgcc1_s.so.1 are used by an other dynamic library. Since they are dynamically linked, objdump -d doesn't resolve the function call addresses. Is there a way short of running the program in a debugger or relinking statically? Thanks, Luca Edit: nm and readelf won't do, I don't need to see which symbols are present in a shared

What is the difference between .o .a and .so files?

巧了我就是萌 提交于 2019-12-20 08:37:23
问题 I know .o are object files, .a are static libraries and .so are dynamic libraries? What is their physical significance? When can I use some and when not? 回答1: .a is an "archive". Although an archive can contain any type of file, in the context of the GNU toolchain, it is a library of object files (other toolchains especially on WIndows use .lib for the same purpose, but the format of these is not typically a general purpose archive, and often specific to the toolchain). It is possible to

Android can't load local libcrypto unsatisfied link error

那年仲夏 提交于 2019-12-20 03:16:24
问题 I need to run a newer version of openssl in my app than the one that comes in the OS. I was able to patch and android source to compile a newer version and then extract the shared library to use in my app. I was then able to compile and link my native code that requires a function only in newer versions of openssl against my new shared library (the patch to a newer openssl worked). I was also able to create a few jni functions that work as expected but as soon as I added in the function that

Keep an exported function from being deleted by the linker

被刻印的时光 ゝ 提交于 2019-12-20 02:26:44
问题 I have a program that statically links with several c++ libraries that export a few functions: extern "C" { KSrvRequestHandler* CreateRequestHandler( const char* name ); bool DestroyRequestHandler( KSrvRequestHandler* handler ); const char** ListRequestHandlerTypes(); } The main program then calls these functions using GetProcAddress/dlsym: #ifdef WIN32 HINSTANCE hDll = GetModuleHandle( NULL ); mCreateHandler = GetProcAddress( hDll, createFuncName ); mDestroyHandler = GetProcAddress( hDll,

Linux equivalent of Windows DLL forwarders or MacOS reexport_library

◇◆丶佛笑我妖孽 提交于 2019-12-20 02:12:31
问题 I have a shared library that tries to provide a standardized interface, basically a list of functions. Some of these functions are already provided by another shared library. So I could just write the additional functions and ask the user to link to both libraries, i.e. have him do this: g++ foo.c -lmine -lother In order to make things easier for the user, however, I don't want to do that. (Given the situation I'm in, this would be way more complicated than just adding a flag in some script.)

Clion & CMake. How To Add Library (*.so)

心不动则不痛 提交于 2019-12-20 00:24:44
问题 I trying write code (c/c++) in Clion IDE . I needs add to my project some shared library. In this moment I want to run just simply program (only main function) which will be able add any function witch my external library libAPIenergy.so. I tryed a few solutions from this forum but anyone nothing help. Below I will present solution which give me least errors. in main function I include #include "APIenergy.h" CMake file cmake_minimum_required(VERSION 3.3) project(TestProject) add_library(