Hello, I make a binding of a C library (in linux).
When I close my program, it freeze, and when I use stop in lazarus (ctrl+f2), the programs stops, but I have a 'External: SIGSEGV'. exception.
my code is this:
var
sr: GevStatus;
h: GEV_CAMERA_HANDLE;
begin
new(h); //need this?
sr := GevOpenCameraByName(PChar('S1233719'), GevExclusiveMode, h);
ShowMessage(IntToStr(sr));
Dispose(h);
end;
The functions GevOpenCameraByName returns 0, means that found a camera. So my program finds the .so file.
The c translation in this:
gevlib = 'libGevApi.so';
//typedef void* GEV_CAMERA_HANDLE;
type
GEV_CAMERA_HANDLE = ^integer;
(...)
//=======================================
// Public Access Mode Value Definitions
//=======================================
{ enum definitions....
typedef enum
{
GevMonitorMode = 0,
GevControlMode = 2,
GevExclusiveMode = 4
} GevAccessMode; }
type
GevAccessMode =
(
GevMonitorMode = 0,
GevControlMode = 2,
GevExclusiveMode = 4);
function GevOpenCameraByName(Name: PChar; mode: GevAccessMode;
handle: GEV_CAMERA_HANDLE): GevStatus; cdecl; external gevlib;
I think the problem is on GEV_CAMERA_HANDLE declaration, because I read this post: [url]https://forum.lazarus.freepascal.org/index.php/topic,49781.0.html[/ur], but I'm don't how to convert the definition. Also my be there is some wrong code.
Any idea?
Thanks in advance
P.D. Program running in lazarus 2.10 and ubuntu 18.04 LTS
/BlueÏcaro