shared-libraries

shared library error about “undefined symbol” when using `dlopen`

江枫思渺然 提交于 2021-02-19 07:44:25
问题 First thing first, here's my minimum reproducible program: CMakeLists.txt: cmake_minimum_required(VERSION 3.17) project(untitled4) set(CMAKE_CXX_STANDARD 17) add_library(lib1 SHARED lib1.cpp) add_executable(untitled4 main.cpp) target_link_libraries(untitled4 PRIVATE dl) main.cpp: #include "iostream" #include <dlfcn.h> int Test() { return 123456; } int main() { auto* handler = dlopen("/home/liu/source/untitled4/cmake-build-debug/liblib1.so", RTLD_LAZY|RTLD_GLOBAL); if (!handler) { std::cerr <<

How to include versioned *.so file into apk using Gradle?

旧街凉风 提交于 2021-02-18 23:45:50
问题 I trying to build android application with some precompiled native libraries: liba.so and libb.so.1.2.3 Libraries are placed into jniLibs subdirectory. After building APK file, only liba.so included into it, but not libb.so.1.2.3 . Result is predictable. Application crashes at start. What to do with build scripts to include all files from jniLibs into APK? 回答1: Unfortunately I don't develop for Android anymore, so I can't test this, but I know Gradle and this might work for you. Looking at

What path does @loader_path resolve to?

半腔热情 提交于 2021-02-18 20:11:34
问题 I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) I want to know where the system looks to find libz.1.dylib. From some Mac documentation: @loader_path/ This

What path does @loader_path resolve to?

好久不见. 提交于 2021-02-18 20:05:23
问题 I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) I want to know where the system looks to find libz.1.dylib. From some Mac documentation: @loader_path/ This

What path does @loader_path resolve to?

随声附和 提交于 2021-02-18 20:05:21
问题 I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) I want to know where the system looks to find libz.1.dylib. From some Mac documentation: @loader_path/ This

What path does @loader_path resolve to?

我是研究僧i 提交于 2021-02-18 20:04:08
问题 I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) I want to know where the system looks to find libz.1.dylib. From some Mac documentation: @loader_path/ This

Eclipse cdt: Includes header file correct, compiles, but highlights source code: “Unresolved inclusion”

蓝咒 提交于 2021-02-18 11:52:41
问题 I have a project that uses a shared library from another project. In project settings I put the correct include paths and library for the GCC and G++ compiler (-L and -l option). It all compiles well, no problems here. But the source code is not analyzed correctly. My included headerfile (that is located in the other project) is marked as "Unresolved inclusion and everywhere I use something from it, the source is highlighted as well. #include "myHeader.h" Any ideas? thanks! 回答1: The one that

Importing class from git - unable to resolve class

馋奶兔 提交于 2021-02-15 07:52:31
问题 I am constructing a Shared Library which I want to have class definitions, such as: package com.org.pipeline.aws String family JsonObject taskDefinition class TaskDefinition { def getTaskDefinition(family) { def jsonSlurper = new groovy.json.JsonSlurper() def object = slurper.parseText( sh(returnStdout: true, script: "aws ecs describe-task-definition --task-definition ${family}" ) ) return assert object instanceof Map taskDefinition = object["taskDefinition"] } } And I am importing it via a

How to make Cmake find tesseract library in Windows (Findtesseract.cmake)?

微笑、不失礼 提交于 2021-02-11 14:31:22
问题 I installed, in Windows, Tesseract, using "Windows Installer made with MinGW-w64 from UB Mannheim" from here, and added to my CMakeLists.txt: find_package(Tesseract REQUIRED) but I get CMake Error at CMakeLists.txt:14 (find_package): By not providing "FindTesseract.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Tesseract", but CMake did not find one. Could not find a package configuration file provided by "Tesseract" (requested

makefile with dependency on a shared library sub project

我怕爱的太早我们不能终老 提交于 2021-02-11 12:38:10
问题 So I have a makefile. I'll just put a pseudo example for the moment just enough so that I can talk about the issue and keep it simple... Let's say I have in my makefile something like this: # Rule to build my test executable - with dependency on the library mytest build: libmytest.so g++ test.cpp -lmytest.so # Rule to build mytest library libmytest.so: g++ mytestlib.cpp -fPIC ... etc ... cc -fPIC -Wl,-soname,libmytest.so ... etc... So, if/when I change the file mytestlib.cpp , I see that