Static loading a dll fails when external declaration starts uppercase
Original Reporter info from Mantis: JHAx86
-
Reporter name: JH
Original Reporter info from Mantis: JHAx86
- Reporter name: JH
Description:
I have tried it many times. In the following declaration:
function SomeFunction(const SomeParam: SomeType): SomeReturnType; cdecl; external 'Mydll.dll';
At debug time, the application fails to starts and a message saying "external: SIGSEGV" appears. But the compiled exe runs well outside Lazarus. To start the application successfully in Lazarus you need to change 'Mydll.dll' to 'mydll.dll'. No big trouble, I know, only beware with the case of you dll declared name but somebody may have troubles when reusing code from Delphi to Lazarus (my case). Also note that 'mydll.dll' will work even if the file name is Mydll.dll. Only matters the declared dll name in your code, not the file name.
Additional information:
A Lazarus project is included to show the bug. The project imports two functions. If you try to run the project inside Lazarus it will crash. Now try double clicking in the exe file (not included, compile it), the program will run as expected. Now go to the code again, and change 'SomeDLL.dll' to 'somedll.dll', it will run well inside Lazarus this time. The dll is written in c++ (CodeBlocks) and a precompiled version is included and the source code too.
Mantis conversion info:
- Mantis ID: 12241
- Version: 0.9.24
- Fixed in version: 0.9.30