I have a console application that call some functoin on a c dll.
The application works good out of the ide, but if I execute it in the lazarus ide, it work or depending on a value setted in a record field.
The environment is Debian sarge, lazarus 0.9.18
this is the code:
begin
errorParams.ErrCode := 0;
errorParams.errstring := '';
vdscb := 0;
sample := 0;
voltage := 0.0;
//=========================================================================
// I. DRIVER INITIALIZATION
//
// Initializes the DSCUD library.
//
//=========================================================================
result := dscInit(DSC_VERSION);
writeln('Init Status = ' + IntToStr(result));
if result <> DE_NONE then
begin
dscGetLastError(errorParams);
writeln(format('dscInit error: %s %s', [dscGetErrorString(errorParams.ErrCode), intToStr(errorParams.ErrCode)] ));
// exit;
end;
//Board initialization
writeln('PROM BOARD INITIALIZATION:');
FillChar(vdsccb, sizeOf(vdsccb), $0);
vdsccb.base_address := $280;
vdsccb.int_level := 5; //with values 0-2 works with values > 3 when I call dscInitBoard I get a sigSegv
DsccbSize := SizeOf(vdsccb);
DsccbSize := SizeOf(MyDsccb);
if dscInitBoard(DSC_PROM, vdsccb, vdscb) <> DE_NONE then
// if dscInitBoard(DSC_PROM, MyDsccb, vdscb) <> DE_NONE then
begin
dscGetLastError(errorParams);
writeln(format('dscInitBoard error: %s %s', [dscGetErrorString(errorParams.ErrCode), errorParams.errstring]));
exit;
end;
Some idea on this?
Thanks, angman :?: