Page 1 of 1

OracleProvider compilation failed on Linux

Posted: Fri 17 Jan 2014 18:17
by jscheid
Hi,

I get an compilation error in OraCallUni.pas in line 5412 on LINUX

Code: Select all

OCIClientVersion := GetProcAddress(OCILib, 'OCIClientVersion');
the error is 'Identifier not found "GetProcAddress"'
I had a look in ODAC 8.5.9 file OraCall.pas and it seem that the correct procedure is called "GetProc" lik in line 5435, so I changed call to

Code: Select all

OCIClientVersion := OCI8.GetProc('OCIClientVersion');

Then I can compile and also install the OraProvider but I get "Access Violation" errors while open up the connection to an Oracle server. I get the same error when I create a new Lazarus Project and only put UniConnection object to this Project an try to connect to an Oracle Server in IDE design mode.
This problem is only releated to Linux not to Windows.
I tested with Oracle Client 10 and 11 on Open Suse 11 and also SLES 11.

Help is very welcome !

Re: OracleProvider compilation failed on Linux

Posted: Fri 17 Jan 2014 18:20
by jscheid
I forgot to mention that I am using Lazarus 1.0.14 with FPC 2.6.2 on x86_64-linux.

Re: OracleProvider compilation failed on Linux

Posted: Wed 22 Jan 2014 13:32
by AlexP
hello,

To solve the problem, you should do the following changes in the DetectOCIClientVersion method:

replace

Code: Select all

  if OCILib = 0 then
    raise Exception.Create('OCI is not loaded.');

{$IFDEF CLR}
  OCIClientVersion := {$IFNDEF UNIDACPRO}OraCallCLR{$ELSE}OraCallCLRUni{$ENDIF}.OCIClientVersion;
{$ELSE}
  OCIClientVersion := GetProcAddress(OCILib, 'OCIClientVersion');
{$ENDIF}
with

Code: Select all

  if OCILib = {$IFNDEF UNIX}0{$ELSE}nil{$ENDIF} then
    raise Exception.Create('OCI is not loaded.');

{$IFDEF CLR}
  OCIClientVersion := {$IFNDEF UNIDACPRO}OraCallCLR{$ELSE}OraCallCLRUni{$ENDIF}.OCIClientVersion;
{$ELSE}
  OCIClientVersion := FOCI8.GetProc('OCIClientVersion');
{$ENDIF}

Re: OracleProvider compilation failed on Linux

Posted: Thu 23 Jan 2014 18:09
by jscheid
Works now !

Thanks a lot,
Juergen

Re: OracleProvider compilation failed on Linux

Posted: Fri 24 Jan 2014 08:16
by AlexP
Hello,

Glad to see that the issue was resolved. If you have any further questions, feel free to contact us.