#1 2018-05-22 18:04:25

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

[SOLVED] Lazarus + Cross-compiling to Linux + SynSQLite3Static

Hi Guys,

When using SynSQLite3Static does not compile with this error:
Error: Error while linking

Note: Compiling to Win64 are ok.

Some clue to what can be?

My environment

Lazarus (Win64): 1.8.2 (stable)
FPC: 3.0.4 (stable)
Cross-compiling to Linux x86_64
fpcupdeluxe-x86_64-win64: V1.6.0q

Other units (-Fu)

..\..\..\FPCUPDeluxe\ccr\mORMot;
..\..\..\FPCUPDeluxe\ccr\mORMot\SQLite3;
..\..\..\FPCUPDeluxe\ccr\mORMot\SQLite3\DDD\infra

Include files (-Fi)

$(ProjOutDir);
..\..\..\FPCUPDeluxe\ccr\mORMot;
..\..\..\FPCUPDeluxe\ccr\mORMot\SQLite3

Libraries (-Fl)

..\..\..\FPCUPDeluxe\ccr\mORMot\static\x86_64-linux

Last edited by macfly (2018-05-23 14:28:40)

Offline

#2 2018-05-22 18:32:53

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: [SOLVED] Lazarus + Cross-compiling to Linux + SynSQLite3Static

Try with the FPC trunk...

Offline

#3 2018-05-22 20:57:19

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [SOLVED] Lazarus + Cross-compiling to Linux + SynSQLite3Static

Thanks for reply

I tried with trunk, but same error.
Also, tried with newpascal, and the same error.

Error while linking

Offline

#4 2018-05-22 21:24:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: [SOLVED] Lazarus + Cross-compiling to Linux + SynSQLite3Static

I am not able to reproduce the problem.

Did you try to delete .o / .ppu and build again?

Offline

#5 2018-05-22 23:51:48

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [SOLVED] Lazarus + Cross-compiling to Linux + SynSQLite3Static

Yes.

And tried again now with "Run -> Clean up and Build", and manually delete all  .o / .ppu files.

Same error.

Offline

#6 2018-05-23 00:44:22

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [SOLVED] Lazarus + Cross-compiling to Linux + SynSQLite3Static

If i comment ALL externall funcs like:

function sqlite3_initialize: integer; cdecl; external; 

And necessarily

CodecGenerateKey(CodecGetReadKey(codec)^,userPassword,passwordLength)

Then compile.

That is, this compile

//function sqlite3_initialize: integer; cdecl; external; 
...
//function sqlite3_trace_v2(DB: TSQLite3DB; Mask: integer; Callback: TSQLTraceCallback;  UserData: Pointer): Pointer; cdecl; external;

...
procedure CodecGenerateReadKey(codec: pointer; userPassword: PAnsiChar; passwordLength: integer); cdecl;
  {$ifdef FPC}public name _PREFIX+'CodecGenerateReadKey';{$endif} export;
begin
  //CodecGenerateKey(CodecGetReadKey(codec)^,userPassword,passwordLength);
end; 

Offline

#7 2018-05-23 06:34:56

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: [SOLVED] Lazarus + Cross-compiling to Linux + SynSQLite3Static

I just did (few minutes ago) a brand new trunk install, with x86_64 cross-compiler for Linux and mORMot on Win10 with fpcupdeluxe-x86_64-win64 V1.6.0q
I could not reproduce your problem.

What happens if you try to compile mORMot Sample 02 for both Windows as well as for Linux 64bit ?

Offline

#8 2018-05-23 14:27:13

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [SOLVED] Lazarus + Cross-compiling to Linux + SynSQLite3Static

Yes this sample compile.

And this gave me a clue to find the problem...

I need to add Interfaces in uses
And add LCL as dependency in the project inspector.


Thank you for your help

Offline

Board footer

Powered by FluxBB