Recent

Author Topic: controls.lpr(731,15) Error: Error while linking in laz4android3.4  (Read 6340 times)

cdbc

  • Hero Member
  • *****
  • Posts: 2678
    • http://www.cdbc.dk
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #15 on: July 07, 2025, 08:10:47 am »
Hi
How about NOT calling your project 'Controls.lpr', but something else... 'Controlling.lpr' perhaps...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

dseligo

  • Hero Member
  • *****
  • Posts: 1674
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #16 on: July 07, 2025, 10:09:00 am »
Hi
How about NOT calling your project 'Controls.lpr', but something else... 'Controlling.lpr' perhaps...
Regards Benny

IMHO, it is not the problem, this will put TS on the wrong track to solve his problem.
Do you use LAMW? LAMW creates projects this with name controls.lpr, TS didn't choose this name.

tetrastes

  • Hero Member
  • *****
  • Posts: 754
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #17 on: July 07, 2025, 12:09:33 pm »
So, I installed LAMW using LAMW Manager v0.3.1.9 (released Feb 23 2025). It installed Lazarus 3.8 (in folder lazarus-trunk  :D) and fpc 3.2.0 (:o). Nevertheless, it successfully builds LAMW examples for Aarch64 and ARMv7a+VFPv3 "chipsets".
About LCL: LAMW depends on LCLBase (at least regandroidbridge.pas from tfpandroidbridge_pack package uses LResources), so while your lpr name is controls, you'll get the "Duplicate unit" notes, though it doesn't prevent to link, as LCL's controls.pp is not used.

As for OP's problem. It seems that he messed options a) and b) installing LAMW (as @nobody.00 noted): https://github.com/jmpessoa/lazandroidmodulewizard/tree/master?tab=readme-ov-file#getting-started
Quote
1. Get Lazarus for Android

Option a) Laz4Android 2.2.2 (Windows)
All cross-android compilers already installed!
arm-android/aarch64-android/i386-android/x86_64-android/jvm-android
hint: Install here: "C:\laz4android2.2.2" (not "Program Files" !!!)
How to:
Install Laz4Android2.2.2
Install LAMW
Download LAMW and unzip it in some folder
recommended folder: "C:\laz4android2.2.2\components"
Packages installations order/sequence:
tfpandroidbridge_pack.lpk (in "..../android_bridges" folder)
lazandroidwizardpack.lpk (in ""..../android_wizard" folder)
amw_ide_tools.lpk (in "..../ide_tools" folder)
Go to "2. Infrastructure Setup".

Option b) LAMW Manager
All in One! LAMW Manage produces a complete Lazarus for Android environment by automating the step "2. Infrastructure Setup"!
LAMW Manager Installer for Linux
LAMW Manager Installer for Windows


Bandy

  • Jr. Member
  • **
  • Posts: 84
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #18 on: July 07, 2025, 02:00:11 pm »
I changed in my test app to Arch64, still the same error.

Project Options, Compiler Options, Paths Other Unit Files: $(ProjOutDir) and Libraries: C:\lamw_manager\LAMW\android-ndk-r28b\toolchains\llvm\prebuilt\windows\sysroot\usr\lib\aarch64-linux-android\22\ [doesn't actually exists; actually exists: C:\lamw_manager\LAMW\android-ndk-r28b\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\aarch64-linux-android\22];C:\lamw_manager\LAMW\android-ndk-r28b\toolchains\aarch64-linux-android-4.9\prebuilt\windows\lib\gcc\aarch64-linux-android\4.9.x\ [doesn't actually exist]

Custom Options in Project Options, Compiler Options (-FDC): -Xd -XPaarch64-linux-android- -FDC:\lamw_manager\LAMW\android-ndk-r28b\toolchains\aarch64-linux-android-4.9\prebuilt\windows\bin (does not actually exists)

I don't know where demo apps are located.

Bandy

  • Jr. Member
  • **
  • Posts: 84
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #19 on: July 07, 2025, 02:02:43 pm »
This are my settings in menu -> Tools -> [LAMW] Android Module Wizard -> Paths Settings [JDK,SDK ,NDK,... ] in attachment.

tetrastes

  • Hero Member
  • *****
  • Posts: 754
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #20 on: July 07, 2025, 03:45:29 pm »
As I understand it, if you installed using LAMW Manager, you must use Lazarus installed by it, not laz4android. Try to find this:

Bandy

  • Jr. Member
  • **
  • Posts: 84
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #21 on: July 07, 2025, 07:04:03 pm »
Yes, I have LAMW4Windows. I started LAMW4Windows and it shows this, see attachment. I selected: Create a new recommended backend. It's OK?

What's the difference between laz4android and LAMW? If I want to create Android apps, what should I use?

tetrastes

  • Hero Member
  • *****
  • Posts: 754
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #22 on: July 07, 2025, 07:20:12 pm »
Yes, I have LAMW4Windows. I started LAMW4Windows and it shows this, see attachment. I selected: Create a new recommended backend. It's OK?
If error is removed, it's OK. In any case you can change it later, or choose debugger on per-project basis.

What's the difference between laz4android and LAMW? If I want to create Android apps, what should I use?

laz4android is installer of lazarus with cross-compilers for android. LAMW is lazarus components for RAD of android apps. You should use lazarus+crosscompilers+LAMW(+sdk,ndk..).
There several options to get this: https://github.com/jmpessoa/lazandroidmodulewizard/tree/master?tab=readme-ov-file#getting-started. The easiest one is Option b) LAMW Manager.

Bandy

  • Jr. Member
  • **
  • Posts: 84
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #23 on: July 07, 2025, 07:34:36 pm »
Yes, error is removed when I selected: Create a new recommended backend.

Bandy

  • Jr. Member
  • **
  • Posts: 84
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #24 on: July 07, 2025, 07:37:48 pm »
How to create a simple apps that shows a simple 'Hello world' message? What should I start: laz4android or LAMW4Windows?

tetrastes

  • Hero Member
  • *****
  • Posts: 754
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #25 on: July 07, 2025, 07:42:22 pm »
As laz4android doesn't work, try LAMW4Windows.  :D

Bandy

  • Jr. Member
  • **
  • Posts: 84
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #26 on: July 07, 2025, 08:18:09 pm »
When I try to ad a jButton to the form AndroidModule1 in LAMW4Windows it shows message from attachment.
« Last Edit: July 07, 2025, 08:20:17 pm by Bandy »

tetrastes

  • Hero Member
  • *****
  • Posts: 754
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #27 on: July 07, 2025, 08:55:04 pm »
Try to open Project options and click OK button. I don't know why, but it helped me.

Bandy

  • Jr. Member
  • **
  • Posts: 84
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #28 on: July 08, 2025, 09:40:56 am »
Clicking OK in Project Options works: I succeeded adding a jButton. Trying to Build (Shift+F9) and Compile (Ctrl+F9) my Hello World app now works ok, I'm guessing. These Messages are in attachment. Please confirm that is OK.

But I can't Run (F9) my app, this command is greyed. Why, please?

tetrastes

  • Hero Member
  • *****
  • Posts: 754
Re: controls.lpr(731,15) Error: Error while linking in laz4android3.4
« Reply #29 on: July 08, 2025, 12:04:54 pm »
I installed LAMW yesterday, so I only can advice you to read documentation https://github.com/jmpessoa/lazandroidmodulewizard/tree/master?tab=readme-ov-file#3-using-lamw.
Quote
3.2.5) Configure you phone device to debug mode/developer options and plug it to the computer usb port
3.2.6) From Lazarus IDE select "Run" -> "[LAMW] Build Apk and Run"

 

TinyPortal © 2005-2018