Page 1 of 1

PB6.10+ ARM : DYLIB cannot be loaded from C++ (QT)

Posted: Fri Nov 15, 2024 4:13 pm
by Niffo
The following code compiled as a shared dylib with PB6.10 ARM (and newer) cannot be opened by a C++ (QT) program. (QLibrary.load() never returns).
The problem does not exist if compiled with PB6.04 ARM.
GetCurrentDirectory() is a content that allow to reproduce but it is not the only one.

Code: Select all

ProcedureDLL EFK_open()
   Define a$ = GetCurrentDirectory()
EndProcedure
  
; IDE Options = PureBasic 6.11 LTS - C Backend (MacOS X - arm64)
; ExecutableFormat = Shared .dylib

Re: PB6.10+ ARM : DYLIB cannot be loaded from C++ (QT)

Posted: Mon Nov 18, 2024 5:33 pm
by Niffo
In fact, DLL generation seems to be problematic with the "C - Backend" compiler. Indeed, our library crashes even under MacOS Intel (x64) when compiled with PureBasic > 6.02.

Re: PB6.10+ ARM : DYLIB cannot be loaded from C++ (QT)

Posted: Mon Nov 18, 2024 5:43 pm
by Fred
Moved here as it's not mac only.

Re: PB6.10+ ARM : DYLIB cannot be loaded from C++ (QT)

Posted: Mon Nov 18, 2024 6:20 pm
by Niffo
I made a mistake, it's only on MacOS (ARM and x64) with the "C Backend" compiler. You should be able to put the thread back in "Bugs - MacOS"

Re: PB6.10+ ARM : DYLIB cannot be loaded from C++ (QT)

Posted: Fri Jan 10, 2025 12:12 pm
by Fred
I tried in C++ with dlopen() and it works, do you have more info why it could fail with QT ?