OracleProvider compilation failed on Linux

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jscheid
Posts: 8
Joined: Sun 02 Oct 2011 17:02

OracleProvider compilation failed on Linux

Post by jscheid » Fri 17 Jan 2014 18:17

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 !

jscheid
Posts: 8
Joined: Sun 02 Oct 2011 17:02

Re: OracleProvider compilation failed on Linux

Post by jscheid » Fri 17 Jan 2014 18:20

I forgot to mention that I am using Lazarus 1.0.14 with FPC 2.6.2 on x86_64-linux.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: OracleProvider compilation failed on Linux

Post by AlexP » Wed 22 Jan 2014 13:32

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}

jscheid
Posts: 8
Joined: Sun 02 Oct 2011 17:02

Re: OracleProvider compilation failed on Linux

Post by jscheid » Thu 23 Jan 2014 18:09

Works now !

Thanks a lot,
Juergen

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: OracleProvider compilation failed on Linux

Post by AlexP » Fri 24 Jan 2014 08:16

Hello,

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

Post Reply