Lazarus

Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: bmcsoft on June 25, 2020, 10:46:10 am

Title: Problem installing Indy on Laz4android
Post by: bmcsoft on June 25, 2020, 10:46:10 am
I can't compile last Indy (10.6.2) on last Laz4android.

IdGlobal.pas(553,29) Fatal: Can't find iconvenc used by IdGlobal.
You tried to use a unit of which the PPU file isn't found by the compiler. Check your configuration file for the unit paths.

Double click on error indicates:
Code: Pascal  [Select][+][-]
  1. {$IFDEF USE_ICONV_ENC}iconvenc, {$ENDIF}
Title: Re: Problem installing Indy on Laz4android
Post by: Remy Lebeau on June 25, 2020, 08:50:56 pm
Android is Java running on top of Linux.  FreePascal has an iconvenc (https://wiki.lazarus.freepascal.org/iconvenc) unit for UNIX platforms, which should include Linux.  Indy defines USE_ICONV_ENC when compiling with FreePascal.  Double-check your FreePascal setup, make sure its search paths are configured correctly, etc.
Title: Re: Problem installing Indy on Laz4android
Post by: PascalDragon on June 25, 2020, 08:57:10 pm
The iconvenc package is not enabled for target Android, so bmcsoft will have to manually compile unit iconvenc located in $fpcdir/packages/iconvenc/src.
Title: Re: Problem running Indy component on Laz4android
Post by: bmcsoft on June 26, 2020, 06:38:48 pm
The iconvenc package is not enabled for target Android, so bmcsoft will have to manually compile unit iconvenc located in $fpcdir/packages/iconvenc/src.

I did it manually by using command "fpc.exe -Parm -Tandroid --//--" and compiler produced 2 files: iconvenc.ppu and iconvenc.o.
But when I drop IdUDPServer on Android form and trying to compile my app in Lazarus IDE (LAMW) I receive the same error.
Compiler critically stopped on module IDGlobal.pas, indicates "iconvenc not found", but when I click on "iconvenc"-string in IDGlobal.pas it opens unit iconvenc.pas from c:\Android\laz4android\fpc\3.0.4\source\packages\iconvenc\src\

How to use my created ppu-file and remove link to pas-file, that can't compile anytime?
Title: Re: Problem installing Indy on Laz4android
Post by: bmcsoft on July 08, 2020, 05:08:34 pm
Remy Lebeau, you should to modify Indy10 to compile on Laz4android.

Your advices do not solve the problem, I described.

Network components "Synapse" compiled today on Laz4android perfectly. So I have to delete all Indy10 components from my project and rewrite the code to use "Synapse".
Title: Re: Problem installing Indy on Laz4android
Post by: Remy Lebeau on July 08, 2020, 07:45:34 pm
The iconvenc package is not enabled for target Android

Why?

so bmcsoft will have to manually compile unit iconvenc located in $fpcdir/packages/iconvenc/src.

Is there another way in FPC that Indy (or in general, any user code) can use iconv on Android, without resorting to accessing the iconv library manually?  Indy needs access to a text encoding library, and on Nix platform (which includes Android) that is currently iconv.
Title: Re: Problem installing Indy on Laz4android
Post by: Remy Lebeau on July 08, 2020, 07:54:55 pm
Compiler critically stopped on module IDGlobal.pas, indicates "iconvenc not found", but when I click on "iconvenc"-string in IDGlobal.pas it opens unit iconvenc.pas from c:\Android\laz4android\fpc\3.0.4\source\packages\iconvenc\src\

That has nothing to do with Indy itself.  That is a FPC/Lazarus issue.

Remy Lebeau, you should to modify Indy10 to compile on Laz4android.

And how would you propose I do that exactly?  Considering that FPC/Lazarus is the one missing the needed functionality in this situation, not Indy.  iconv is a system library, Indy needs access to it.  And while Indy does have its own IdIconv.pas unit, it is not currently setup for Android, and I would like to avoid using that unit if possible.

Your advices do not solve the problem, I described.

Then you need to fix THAT problem, and stop blaming Indy.  You already recompiled the iconvenc unit, like PascalDragon told you to.  So now you just need to figure out how to get FPC/Lazarus to find the PPU file you compiled.  That is a separate issue.

How to use my created ppu-file and remove link to pas-file, that can't compile anytime?

I can't answer that, as I don't use FPC/Lazarus myself.  Someone else in the FreePascal community will have to address that for you.  All of Indy's FPC/Lazarus support has been through contributions from the FreePascal community.

Network components "Synapse" compiled today on Laz4android perfectly.

Good for them.  They don't have the same functionality that Indy has, especially when it comes to Unicode text handling, which is very important in many modern Internet protocols.

So I have to delete all Indy10 components from my project and rewrite the code to use "Synapse".

Or,  you could just fix the issue with the iconvenc unit and move on.
Title: Re: Problem installing Indy on Laz4android
Post by: bmcsoft on July 08, 2020, 10:21:50 pm
Remy Lebeau, thanks for explanations.

PascalDragon, could anyone from Lazarus-team help me to compile Indy10 and projects with it on Laz4android?

Compiler permanently linked to "iconvenc.pas" and I don't know how to replace it with manually compiled unit (ppu).

Title: Re: Problem running Indy on Laz4android
Post by: bmcsoft on July 08, 2020, 11:53:57 pm
I guess to add link to PPU-directory in Compiler Parameters - Other Modules.
One problem is gone, but other problem is still.

When I add IdUDPServer, IdGlobal in uses section I get critical error too.

Quote
C:\Android\android-ndk-r14b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-ld.bfd.exe: cannot find -liconv
controls.lpr(632,15) Error: Error while linking

When I remove this modules from uses section, application compiled normally.

===

It's hard to understand what's wrong.
Title: Re: Problem installing Indy on Laz4android
Post by: Remy Lebeau on July 09, 2020, 09:02:06 pm
I wonder - does FPC's libc unit have iconv definitions on Android?

For comparison, Delphi uses ICU instead of ICONV for its own text conversions under Android.  I wonder if they did that because ICONV has issues under Android?  There is already an open ticket for Indy to add support for ICU (https://github.com/IndySockets/Indy/issues/156) because of that.
TinyPortal © 2005-2018