490 questions
Tooling
0
votes
0
replies
38
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
125
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
89
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
116
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
108
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
60
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
44
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
175
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
513
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
73
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
45
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
110
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
156
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 ...