project1.lpr(20,1) Warning: "crti.o" not found, this will probably cause a linking failure
project1.lpr(20,1) Warning: "crtn.o" not found, this will probably cause a linking failure
project1.lpr(20,1) Error: Error while linking
I get this errors even if I create a new empty project via Menu Project / New Project / Application (see attached project).date time size path and file
---------------------------------
16.04.18 22:14 1216 /usr/lib/x86_64-linux-gnu/crti.o
16.04.18 22:14 648 /usr/lib/x86_64-linux-gnu/crtn.o
16.04.18 22:14 1084 /usr/lib32/crti.o
16.04.18 22:14 440 /usr/lib32/crtn.o
16.04.18 22:14 836 /usr/libx32/crti.o
16.04.18 22:14 440 /usr/libx32/crtn.o
Compile Project, CPU: i386, Target: /home/hg6/utis/project1: Exit code 256, Errors: 1
Linking /home/hg6/utis/project1
/usr/bin/ld: warning: /home/hg6/utis/link.res contains output sections; did you forget -T?
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so wird bei der Suche nach -lgdk-x11-2.0 übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.a wird bei der Suche nach -lgdk-x11-2.0 übersprungen
/usr/bin/ld: -lgdk-x11-2.0 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libX11.so wird bei der Suche nach -lX11 übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libX11.a wird bei der Suche nach -lX11 übersprungen
/usr/bin/ld: -lX11 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so wird bei der Suche nach -lgdk_pixbuf-2.0 übersprungen
/usr/bin/ld: -lgdk_pixbuf-2.0 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so wird bei der Suche nach -lgtk-x11-2.0 übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.a wird bei der Suche nach -lgtk-x11-2.0 übersprungen
/usr/bin/ld: -lgtk-x11-2.0 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgobject-2.0.so wird bei der Suche nach -lgobject-2.0 übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgobject-2.0.a wird bei der Suche nach -lgobject-2.0 übersprungen
/usr/bin/ld: -lgobject-2.0 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libglib-2.0.so wird bei der Suche nach -lglib-2.0 übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libglib-2.0.a wird bei der Suche nach -lglib-2.0 übersprungen
/usr/bin/ld: -lglib-2.0 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgthread-2.0.so wird bei der Suche nach -lgthread-2.0 übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgthread-2.0.a wird bei der Suche nach -lgthread-2.0 übersprungen
/usr/bin/ld: -lgthread-2.0 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgmodule-2.0.so wird bei der Suche nach -lgmodule-2.0 übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libgmodule-2.0.a wird bei der Suche nach -lgmodule-2.0 übersprungen
/usr/bin/ld: -lgmodule-2.0 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libpango-1.0.so wird bei der Suche nach -lpango-1.0 übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libpango-1.0.a wird bei der Suche nach -lpango-1.0 übersprungen
/usr/bin/ld: -lpango-1.0 kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libcairo.so wird bei der Suche nach -lcairo übersprungen
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libcairo.a wird bei der Suche nach -lcairo übersprungen
/usr/bin/ld: -lcairo kann nicht gefunden werden
/usr/bin/ld: inkompatibles //usr/lib/x86_64-linux-gnu/libatk-1.0.so wird bei der Suche nach -latk-1.0 übersprungen
/usr/bin/ld: -latk-1.0 kann nicht gefunden werden
project1.lpr(20,1) Error: Error while linking
Although I switched Lazarus to English, most messages are in German. Translated they mean:# path to the gcclib
#ifdef cpui386
-Fl/usr/lib/gcc/x86_64-linux-gnu/7/32 <- path exists
#endif
#ifdef cpux86_64
-Fl/usr/lib/gcc/x86_64-linux-gnu/7 <- path exists
#endif
# searchpath for libraries
#-Fl/usr/lib/fpc/$fpcversion/lib
#-Fl/lib;/usr/lib
-Fl/usr/lib/fpc/$fpcversion/lib/$FPCTARGET <- path does NOT exist
sudo fpcmkcfg -d basepath=/usr/lib/fpc/\$fpcversion -o ./fpc.cfg
but this changed only 1 line with -FM option (see attached file) and I get the same error messages as before.1) Uninstalled Lazarus, fpc-src, fpc
2) Installed fpc_3.0.4-3_amd64.deb using Gdebi
3) Installed fpc-src_3.0.4-2_amd64.deb using Gdebi
4) Restarted the computer
5) Disconnect the internet connection
6) Installed lazarus-project_1.8.4-0_amd64.deb using Gdebi
12) Did version locking on fpc and fpc-src using Muon Package Manager (having KDE-Plasma desktop)
Before this installation I tried different other installations, but then enabling of cross-compiling was not possible.#IFDEF LINUX
#IFDEF CPU32
-Fl/usr/lib32
-Xd
#ENDIF
#ENDIF
And you need to install 32-bit versions of GTK2 and other libraries.How do I install this? I searched Synaptic Package Manager for "gtk2" and found ca. 90 matches which have something with gtk2 in it's name, but nothing named "gtk2" and nothing which looked like 32 bit. Sorry for my question, I'm an absolute beginner on Linux and nearly everything is new to me...
... due to ABI changes in 32-bit libraries. 32-bit FPC doesn't adhere to this ABI change...I never heared ABI before. Do you mean https://en.wikipedia.org/wiki/Application_binary_interface ?
See this bug report for more info : https://bugs.freepascal.org/view.php?id=33425I read this report but understood nearly nothing. What do you want me to say?
Thank you very much for you reply. I added the 5 lines to the end of fpc.cfg file.And you need to install 32-bit versions of GTK2 and other libraries.How do I install this? I searched Synaptic Package Manager for "gtk2" and found ca. 90 matches which have something with gtk2 in it's name, but nothing named "gtk2" and nothing which looked like 32 bit. Sorry for my question, I'm an absolute beginner on Linux and nearly everything is new to me...
Quote... due to ABI changes in 32-bit libraries. 32-bit FPC doesn't adhere to this ABI change...I never heared ABI before. Do you mean https://en.wikipedia.org/wiki/Application_binary_interface ?
QuoteSee this bug report for more info : https://bugs.freepascal.org/view.php?id=33425I read this report but understood nearly nothing. What do you want me to say?
Thanks again for your help. Or is cross-compiling a GUI application to difficult for a Linux beginner?
I have Lazarus 1.8.4 on Ubuntu 18.04 64 bit. Compiling a 64 bit GUI program or a 32 bit console program works. But compiling a 32 bit GUI program leeds to:Code: [Select]project1.lpr(20,1) Warning: "crti.o" not found, this will probably cause a linking failure
project1.lpr(20,1) Warning: "crtn.o" not found, this will probably cause a linking failure
project1.lpr(20,1) Error: Error while linking
# Do another Run | Build and it should successfully build a 32-bit executable.
# (you have to run this from a 32-bit Linux OS, or from a 64-bit OS with the proper libraries installed)
I also need to run the 32 bit program on my 64 bit Ubuntu.
...
Please, which are "the proper libraries installed" which I need to run a 32 bit GUI program?
Compile Project, CPU: i386, Target: project2: Exit code 256, Errors: 1
/opt/lazarus_184/cross/lib/i386-linux//libresolv.so.2: undefined reference to `__res_maybe_init@GLIBC_PRIVATE'
/usr/lib/i386-linux-gnu//libgio-2.0.so.0: undefined reference to `g_build_filename_valist'
project2.lpr(20,1) Error: Error while linking
Code: [Select]Compile Project, CPU: i386, Target: project2: Exit code 256, Errors: 1
/opt/lazarus_184/cross/lib/i386-linux//libresolv.so.2: undefined reference to `__res_maybe_init@GLIBC_PRIVATE'
/usr/lib/i386-linux-gnu//libgio-2.0.so.0: undefined reference to `g_build_filename_valist'
project2.lpr(20,1) Error: Error while linking
Did you change the default installation location when you ran fpcupdeluxe?Yes, I changed it to /opt/lazarus_184/ and took ownership by "sudo chown -R hg6:hg6 /opt/lazarus_184". Hope this was the correct way.
When you run Lazarus (the one fpcupdeluxe installed), the environment has to be setup to run from the correct folders and use the correct config files.Yes, as you requested in your helpful introductions how to use fpcupdeluxe.
Are you running Lazarus using the desktop link which fpcupdeluxe creates?
Or, alternately running Lazarus using the launch script created in your home folder (~/Lazarus_fpcupdeluxe)?
Uninstalling the i386 libraries allows a Lazarus 32-bit minimal application to build again:sudo apt purge libgtk2.0-0:i386 libx11-6:i386 libgdk-pixbuf2.0-0:i386 libglib2.0-0:i386 libpango-1.0-0:i386 libcairo2:i386 libatk1.0-0:i386
sudo apt autoremove
Compile Project, CPU: i386, Target: project2: Exit code 256, Errors: 1
Free Pascal Compiler version 3.0.4-r1:37121 [2018/10/22] for i386
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling project2.lpr
Compiling unit2.pas
unit2.pas(18,28) Parameter "Sender" not used
unit2.pas(19,28) Parameter "Sender" not used
Compiling resource /home/hg6/lazarus_experimente/lib/i386-linux/project2.or
/opt/lazarus_184/cross/bin/i386-linux/i386-linux-ld: warning: link.res contains output sections; did you forget -T?
Linking project2
/opt/lazarus_184/cross/lib/i386-linux//libresolv.so.2: undefined reference to `__res_maybe_init@GLIBC_PRIVATE'
project2.lpr(20,1) Error: Error while linking
project2.lpr(20,1) Verbose: There were 1 errors compiling module, stopping
/opt/lazarus_184/cross/lib/i386-linux//libresolv.so.2: undefined reference to `__res_maybe_init@GLIBC_PRIVATE'
After a lot of google'ing and some experiments I renamed file /opt/lazarus_184/cross/lib/i386-linux/libresolv.so.2 so that it can't be found. After that this error does not occur any longer.date time size path + filename
---------------------------------------
16.04.18 22:14:20 17 /lib/i386-linux-gnu/libresolv.so.2
18.08.18 17:25:59 17 /lib/x86_64-linux-gnu/libresolv.so.2
16.04.18 22:14:20 17 /lib32/libresolv.so.2
16.04.18 22:14:20 17 /libx32/libresolv.so.2
15.04.16 01:00:32 87876 /opt/lazarus_184/cross/lib/i386-linux/libresolv.so.2
15.01.18 05:19:52 17 /snap/core/5328/lib/i386-linux-gnu/libresolv.so.2
15.01.18 04:51:26 17 /snap/core/5328/lib/x86_64-linux-gnu/libresolv.so.2
15.01.18 05:19:52 17 /snap/core/5548/lib/i386-linux-gnu/libresolv.so.2
15.01.18 04:51:26 17 /snap/core/5548/lib/x86_64-linux-gnu/libresolv.so.2
15.01.18 05:19:52 17 /snap/core/5662/lib/i386-linux-gnu/libresolv.so.2
15.01.18 04:51:26 17 /snap/core/5662/lib/x86_64-linux-gnu/libresolv.so.2
15.01.18 05:19:52 17 /snap/wine-platform-i386/20/lib/i386-linux-gnu/libresolv.so.2
15.01.18 05:19:52 17 /snap/wine-platform-i386/22/lib/i386-linux-gnu/libresolv.so.2
15.01.18 05:19:52 17 /snap/wine-platform-i386/23/lib/i386-linux-gnu/libresolv.so.2
16.04.18 22:14:20 34 /usr/lib/i386-linux-gnu/libresolv.so
16.04.18 22:14:20 36 /usr/lib/x86_64-linux-gnu/libresolv.so
16.04.18 22:14:20 21 /usr/lib32/libresolv.so
16.04.18 22:14:20 22 /usr/libx32/libresolv.so
You see, the file in /opt/lazarus_184/ is very old. Can this be the root cause, that fpcupdeluxe installs a library which is to old? /usr/lib/i386-linux-gnu//libgio-2.0.so.0: undefined reference to `g_build_filename_valist'
date time size path + filename
---------------------------------------
10.04.16 22:52:52 1,865020 /opt/lazarus_184/cross/lib/i386-linux/libgio-2.0.so.0
31.07.18 07:41:43 22 /snap/core/5328/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
31.07.18 07:42:26 1,599368 /snap/core/5328/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.2
18.09.18 14:07:14 22 /snap/core/5548/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
18.09.18 14:07:45 1,599368 /snap/core/5548/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.2
18.09.18 14:07:14 22 /snap/core/5662/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
18.09.18 14:07:45 1,599368 /snap/core/5662/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.2
29.03.18 15:34:30 22 /snap/gnome-3-26-1604/59/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
31.10.17 15:39:55 1,674264 /snap/gnome-3-26-1604/59/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5400.1
09.07.18 15:48:30 22 /snap/gnome-3-26-1604/70/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
09.07.18 15:48:36 1,686776 /snap/gnome-3-26-1604/70/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5600.1
09.07.18 15:48:30 22 /snap/gnome-3-26-1604/74/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
09.07.18 15:48:36 1,686776 /snap/gnome-3-26-1604/74/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5600.1
18.09.18 14:13:14 22 /snap/wine-platform-i386/20/usr/lib/i386-linux-gnu/libgio-2.0.so.0
18.09.18 14:14:17 1,865020 /snap/wine-platform-i386/20/usr/lib/i386-linux-gnu/libgio-2.0.so.0.4800.2
18.09.18 14:13:14 22 /snap/wine-platform-i386/22/usr/lib/i386-linux-gnu/libgio-2.0.so.0
18.09.18 14:14:17 1,865020 /snap/wine-platform-i386/22/usr/lib/i386-linux-gnu/libgio-2.0.so.0.4800.2
18.09.18 14:13:14 22 /snap/wine-platform-i386/23/usr/lib/i386-linux-gnu/libgio-2.0.so.0
18.09.18 14:14:17 1,865020 /snap/wine-platform-i386/23/usr/lib/i386-linux-gnu/libgio-2.0.so.0.4800.2
17.09.18 14:52:54 22 /usr/lib/i386-linux-gnu/libgio-2.0.so.0
17.09.18 14:52:54 1,984508 /usr/lib/i386-linux-gnu/libgio-2.0.so.0.5600.2
17.09.18 14:52:54 22 /usr/lib/x86_64-linux-gnu/libgio-2.0.so
17.09.18 14:52:54 22 /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
17.09.18 14:52:54 1,690808 /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5600.2
You see, that the file in /opt/lazarus_184/ is very old too, but it seems not beeing used and renaming it did not help. Maybe we have here also a version conflict?You can try this.
You can point fpcupdeluxe towards your own system 32bit library.
In your case: /lib32
You can try this
...
After setting these locations, you can build the cross-compiler again.
# path to the gcclib
#ifdef cpui386
-Fl/usr/lib/gcc/x86_64-linux-gnu/7
#endif
# searchpath for libraries
-Fl/home/user/fpcupdeluxe2/fpc/lib/$FPCTARGET
# library search path
-Fl/usr/lib/$FPCTARGET;/usr/lib/$FPCTARGET-gnu;/lib/$FPCTARGET;/lib/$FPCTARGET-gnu;/usr/lib/gcc/x86_64-linux-gnu/7.3.0
Your fpc.cfg does not look like anything that has been generated by fpcupdeluxe !
Your fpc.cfg does not look like anything that has been generated by fpcupdeluxe !
#tested on Xubuntu 18.04 64-bit (starting from a minimal OS install)
#install fpcupdeluxe dependencies
sudo apt install -y libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev libxtst-dev libatk1.0-dev libghc-x11-dev freeglut3 freeglut3-dev
sudo apt install -y git subversion make build-essential gdb zip unzip unrar wget
#install dependencies for a 32-bit executable built with Lazarus
sudo apt install libgtk2.0-0:i386 libx11-6:i386 libgdk-pixbuf2.0-0:i386 libglib2.0-0:i386 libpango-1.0-0:i386 libcairo2:i386 libatk1.0-0:i386
#use latest fpcupdeluxe to build Laz/fpc stable/stable and crosscompiler i386/linux
https://github.com/newpascal/fpcupdeluxe/releases/tag/1.6.2e
#Open Lazarus and perform a "Clean up and Build" of a minimal application (empty form) with i386 target CPU
#Errors:
Compile Project, CPU: i386, Target: project1: Exit code 256, Errors: 1
/lib/i386-linux-gnu//libmount.so.1: undefined reference to `getrandom@GLIBC_2.25'
/usr/lib/i386-linux-gnu//libgio-2.0.so.0: undefined reference to `g_build_filename_valist'
/lib/i386-linux-gnu//libbsd.so.0: undefined reference to `__explicit_bzero_chk@GLIBC_2.25'
project1.lpr(20,1) Error: Error while linking
sudo apt purge libgtk2.0-0:i386 libx11-6:i386 libgdk-pixbuf2.0-0:i386 libglib2.0-0:i386 libpango-1.0-0:i386 libcairo2:i386 libatk1.0-0:i386
sudo apt autoremove
I'd recommend using a separate fpc.cfg and a completely separate directory structure independent from the installed OS that contains the libraries you need for cross-compilation.I thought I did this by using fpcupdeluxe to create a separate Lazarus installation with its own fpc.cfg and its own library folder <install_folder>/cross/lib/i386-linux/
In setup+ , you can choose your os and cpu in "Custom tools location ..."In setup+ , I first set "Search options" to custom and then enter the lib-Path in "Libraries" and the bin-Path in "Tools"?
And enter your location where to find the bins and the libs.
I think ..you can not install package libgtk2.0-dev:i386 and libgtk2.0-dev In the same device
It is the hell of a conflict between packages
There is a separate forum thread about fpcupdeluxe http://forum.lazarus.freepascal.org/index.php/topic,34645.0.html
It is best if you post fpcupdeluxe related questions there !