490 questions
Tooling
0
votes
0
replies
41
views
Create a runtime location for a dynamic library using the nim FFI
Is it possible to define the dynamic library location for an FFI at runtime?
I have successfully generated an FFI for SFCGAL using toast in the nim programming context, but struggled a bit with the ...
1
vote
1
answer
161
views
What is the source of difference in size of statically built and dynamically built libraries in the boost library
On installing boost library (of which boost graph library is a part), the following has been installed on my computer:
(1) C:\local\boost_1_86_0\boost\graph\header files.hpp
(2) C:\local\boost_1_86_0\...
0
votes
0
answers
111
views
library handle in fortran
I have a fortran dll/so which needs to know its own programhandle.
On windows, I can obtain the handle from the DLLMain routine:
integer(4) function DllMain(hInst, ul_reason_being_called, lpReserved)
...
1
vote
1
answer
121
views
Optional library without dlopen/LoadLibrary
Does Linux and/or Windows have a way to mark a dynamic library as optional, so that if it does exist, it is loaded and used to populate the symbol table, but if it does not, then the symbols are left ...
-1
votes
1
answer
111
views
Unable to reload a C# dll from C#
Good morning. I want to reload a dll at runtime but I can't. I have two programs lets name them host and plugin. Host compiles to an executable and plugin compiles to a dll. Host loads a function from ...
0
votes
1
answer
67
views
Why doesn't RTLD_LOCAL solve this symbol conflict when loading dynamic libraries?
I have one dynamic library with the function:
extern "C" void start() {
}
And a second dynamic library with the function:
extern "C" void start() {
}
Exactly the same. I open up ...
0
votes
1
answer
45
views
Free Pascal dylib exports with name clauses not findable via dlsym on macOS
I'm creating a Free Pascal dynamic library (.dylib) on macOS that works on Windows but fails to load symbols on macOS. The symbols appear in the symbol table when checked with nm, but dlsym cannot ...
-2
votes
1
answer
187
views
Calling Vulkan function at program exit results in segmentation fault [closed]
In C++ it's a good idea to wrap any cleanup in the destructor of an object, and so my Vulkan objects look something like:
struct MyVulkanObject
{
VkCommandPool handle;
~MyVulkanObject()
...
1
vote
0
answers
100
views
Why is a release build dynamic library function slow when called from a debug build executable?
I'm trying to set up the Slang shader compiler, and the first step is to create a global session with:
SlangResult slang_result = slang::createGlobalSession();
This takes a long time, like 5 seconds ...
1
vote
1
answer
134
views
Crash when dlopening shared library which accesses global variable in constructor
This simple library
$ cat foo.c
int glob;
int foo() {
return 0;
}
__attribute__((constructor))
void init() {
glob = foo();
}
$ gcc -g -O0 -shared -fPIC foo.c -o libfoo.so
loads fine when I ...
0
votes
1
answer
533
views
Loading external Native Libraries to the JVM at Runtime in Java 21
I want to load an external library (eg:\Lic\64bit) which contains some DLL files inside it to JVM at runtime. Can't use Reflection and FFM (Java Foreign Function Memory API) as well.
I tried with some ...
0
votes
0
answers
74
views
Right way to avoid multiple definition error when building Python C++ extension with MSVC BuildTools
A python C++ extension has the following structure:
/myextension
|_____basecode
| |__header.h
| |__functions.cpp
|
|_____utilities
| |______utilities.h
| |...
0
votes
0
answers
48
views
What could be the reason for openmp to constantly recreate the thread pool?
My program runs on linux, and uses a openmp-enabled dynamic library (named calc.so) for fast parallel computation, calc.so exports this function double calc(double* data).
When the program is running, ...
1
vote
1
answer
113
views
Call function from dynamic library with changing signature?
Say I have hello1.c
char *greeting = "Hello, Version 1";
char *greet(void) {
return greeting;
}
and hello2.c
int greeting = 42;
int greet(void) {
return greeting;
}
My host.c looks ...
0
votes
1
answer
159
views
Segfault on calling function pointer obtained with dlopen() in Rust
I am currently playing with POSIX functions defined in dlfcn.h with Rust, with the goal of calling a function in a separated .so file.
The project actually contains 2 crates:
The binary loading the ...
0
votes
1
answer
384
views
Flutter Dart DynamicLibrary on separate thread (Isolate) can't be called
I have application written on Flutter (Dart) and I have integrated FFI library. I need to call a method from that library on a separate Isolate but it gives me a following error:
Unhandled Exception: ...
1
vote
1
answer
299
views
Link shared library through makefile
The code compiles as it should, but somehow, the binary file doesn't know where the library is.
❯ ldd myteams_cli
linux-vdso.so.1 (0x00007ffcbc1b4000)
libmyteams.so => not found
...
0
votes
2
answers
375
views
Link OpenCV library to a Scala project
I've been trying to run a Scala project that uses the library OpenCV. I am using maven to build the project and in the pom.xml file I have the following dependency:
<dependency>
<groupId&...
0
votes
1
answer
148
views
Is there a better way to define multiple function definitions when using a dynamic library?
The following code listing works just fine - but as I'm still dipping my toes into the C++ waters, I'm wondering if there is a better - more generic - way to define each of the function definitions.
I ...
2
votes
1
answer
239
views
What does C++ standard say about dynamic libraries?
What does C++ standard say about dynamic libraries? I heard that it completely ignores them (for some reason) - if it's true, why so?
1
vote
0
answers
166
views
Exposing common API from main program *to* dylib in Rust
I'm planning on making a game in Rust, and I'd like to have native plugins/mods in the form of dynamic libraries. I'm planning on using libloading for this.
Mods will be able to add new entities and ...
0
votes
1
answer
218
views
failed to find version script file when linking a dynamic library by using bazel cluster
I was building a shared/dynamic library by using bazel. The rules in Build file are like below
cc_library(
name = "a",
srcs = ["a.cc"]
)
filegroup(
name = "vis_ld&...
1
vote
2
answers
2k
views
What is a real purpose of dynamic linking in c++?
I'm new to this and don't understand why I should use dynamic linking when there is static linking.
I know that dynamic linking reduces the size of the program file, but if it is a custom dynamic ...
0
votes
0
answers
62
views
use shared library with eclipse on windows
On Windows 10, using eclipse for c projects I have installed the MinGW compiler. I've been able to add a static library (*.h, *.c files). I can't for some reason get a shared library to work.
I ...
3
votes
2
answers
126
views
I want to release a C dynamic library for linux. At run time, will it be compatible with any linux version?
My little open-source C/C++ project also offers precompiled dynamic libraries to allow other languages to bind. For Windows I just provide x86 and x64 versions. For Macos, I propose an intel x64 ...
-1
votes
1
answer
1k
views
How can I use a library without a header file path in cmake?
I'm trying to create a simple library using cmake and create an app that uses it.
However, while creating an app, I must specify the path to the header file used in the library for the build to ...
0
votes
0
answers
39
views
My cygwin gcc report conflicting types error when building dynamic link library using JNI
I was using cygwin gcc (7.4.0-x64) on windows to build dynamic link library for java.
Here reports the error:
H:\ddlog/java/ddlogapi.c:1057:28: error: conflicting types for '...
1
vote
0
answers
75
views
What happens when a shared object is loaded
I have written a pam module using Golang and C, similar to https://github.com/uber/pam-ussh. I am noticing an issue with the signal handler of Golang even though my PAM module is never called to ...
0
votes
1
answer
130
views
How to enter the source file of a dynamic lib (.so) when debugging
Recently, I want to add some breakpoints and debug some ROS libraries step by step to learn how these functions are called. These ROS libraries have been built from source.
However, I found that all ...
0
votes
0
answers
190
views
How can I Import a *.so file into a *.jar while using Maven build tools?
How can I Import a *.so file into a *.jar while using Maven build tools? And could load that *.so file?
considering convenience of the deployment usage.
I want to load native methods from *.so then ...
0
votes
1
answer
42
views
Could the JVM load a dynamic LIBRARY from network?if could be and how? THANKS
Could the JVM load a dynamic LIBRARY from network?if could be and how? THANKS
I am studying JNI recently.
I am working wiht mates, when other mates developing in theirs environment, they haven't the ....
0
votes
0
answers
232
views
How to add ARC for a single .dylib file
In the recent Penetration test of our iOS app we found a vulnerability that {appName}.app/Frameworks/libswiftCoreImage.dylib does not enforce automatic reference counting protection.How to enable the ...
2
votes
1
answer
450
views
XCode: specify different dylib paths for builds of different architectures
I'm trying to build a MacOS app for both x86_64 and arm64 architectures.
I'm also linking it with some .dylib libraries which I have in both architectures.
In XCode I figured that I can set the search ...
-1
votes
1
answer
983
views
Are both static libraries and dynamic libraries compiled during the build process?
When you build an app,
You have to compile and then link.
Whether you link a framework dynamically or statically, you still have to compile them both.
It’s just that for a static library, you link at ...
0
votes
1
answer
154
views
Accessing an external variable from a C library
I am currently learning C and am trying to understand the possibilities of dynamic libraries.
My current question is, if I have a simple "Hello World" application in C called "ProgA&...
0
votes
2
answers
1k
views
Use CMake to build dependency (oneTBB as git submodule) as dynamic library?
I have a project that depends on Intel's oneTBB. My project is structured as follows:
external/
| - CMakeLists.txt
| - oneTBB/ (this is a git submodule)
| - ...
include/
lib/
include/
...
1
vote
0
answers
2k
views
How to install libapt-pkg.so.5.0 on Ubuntu 20.04
I have a dynamic library that I want to use. However, one of its dependencies is not available on my system:
$ ldd redacted_name.so | grep 'not found'
libapt-pkg.so.5.0 => not found
I ...
4
votes
2
answers
3k
views
Can Go executable be used as a dynamic library?
I am writing a generic library in GoLang and want to publish it (like a dynamic library) to be used by other apps written in any language.
If I write this lib in C/C++, I would have generated a .dll ...
0
votes
1
answer
555
views
Optional dynamic library
Background
Trying to profile an executable, I experimented the profiler Intel VTune and I learn that there is an API library (ITT) that provide utility to start/stop profiling. Its basic functions ...
0
votes
0
answers
865
views
X11 not being linked into static library
So I am building a tiny "game engine" in C++, using cmake to build it, and I am making it as a static library. In windows it works perfectly, but in linux I need to link X11.
Now this wouldn'...
0
votes
4
answers
215
views
Could not find the entrypoint _pcre2_compile@40. (3260)
I have built a libpcre2-8.dll with the help of this Git Repo.
I'm now trying to access the function pcre2_compile from an ABL (Progress) program. (Progress is an old 4GL Language). I'm constantly ...
2
votes
1
answer
359
views
What is the C++ way of interpreting the void* returned by dlsym as a pointer-to-function?
Assume a dynamic library exports a function, e.g. of type void(), named foo. A client code could then make use of it like in the following snippet (assuming foo is exposed via extern "C" ...
0
votes
1
answer
1k
views
iOS App backed with cpp dyld crashes with error "missing symbol called"
I got an iOS App with following nested structure:
iOS App (swift + objC) {
iOS Framework (objC + C++) {
dynamic library (C++) {
static library (C++)
}
}
}
It links and compiles ...
0
votes
1
answer
422
views
Are dynamic libraries loaded on startup or only when required by executable
Take a C application running on Linux for example which is dynamically linked with a required shared library.
I know that the .so file should be found in the paths defined in the environment variable ...
0
votes
1
answer
366
views
Loading shared object to specific processes in Linux
I want to load a shared object to certain processes, there are certain conditions that are required:
Loading to only specific processes and not all of them;
It has to be done before the process code ...
0
votes
1
answer
744
views
How to configure a dynamic library using a macro / variable in a makefile?
I'm writing a small study project in C. I need to create a dynamic library and configure its use with macros. First, I create object files with the command:
$gcc -fPIC -c ../data_module/data_process.c
...
0
votes
1
answer
564
views
gnuradio OOT module can't access shared object file while using gnuaradio companion (linux)
I've made an OOT module that uses a dynamic shared library.
The library files are located at "/home/username/intel/oneapi/ipp/2021.6.0/lib/intel64".
I've added to the module_folder/lib/...
0
votes
1
answer
1k
views
Dynamic c++ Library in Python - can't find dylib file
I am trying to import a c++ function for use in Python(3.9) on MacOS. My project has the following structure,
.
├── CMakeLists.txt
├── cmake-build-debug
│ ├── CMakeCache.txt
│ ├── CMakeFiles
│ ├─...
2
votes
1
answer
2k
views
C++ Dependency injection with Dynamic library loading
I am unable to use C++ dependency injection library "boost::di" with another boost library for dynamic loading of libraries named "Boost.dll".
I broke down the problem into two ...
0
votes
0
answers
136
views
SSL connect error/crash under strange circumstances
When using libQuickMail in the shared object, the application crashes when loading from that so.
Say I have two programs:
program 1 is a program that loads a shared object. We'll call this program &...