* * *

Author Topic: [SOLVED] libraries-not-found-errors when cross-compiling 32 bit GUI application  (Read 1733 times)

Hartmut

  • Full Member
  • ***
  • Posts: 210
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
I get this errors even if I create a new empty project via Menu Project / New Project / Application (see attached project).

I searched for this error in goggle and this forum and got a couple of matches, but the only solution I understand was to add a -Fl option to fpc.cfg. But which path must I add?

I searched my HD for this 2 files and found:
Code: [Select]
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

I suppose from the name that the 1st path is 64 bit. From comparing /usr/lib32/ and /usr/libx32/ I suppose the last is 64 bit so I added "/usr/lib32/" in Lazarus to my Compiler Options / Path / Libraries (-Fl). Then I got:
Code: [Select]
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:
   incompatible xxx is skipped while searching for yyy
   yyy cannot be found
   
I found my fpc.cfg (see attached) in /etc/. All places with "-Fl" are:
Code: [Select]
# 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

I hoped to repair my fpc.cfg via Tool fpcmkcfg. In /etc/ I entered
Code: [Select]
sudo fpcmkcfg -d basepath=/usr/lib/fpc/\$fpcversion -o ./fpc.cfgbut this changed only 1 line with -FM option (see attached file) and I get the same error messages as before.

I'm a total beginner to Linux and to cross compiling. Any help is welcome. Thanks a lot in advance.

Here is how I installed Lazarus (according to https://forum.lazarus.freepascal.org/index.php/topic,41524.0.html):
Code: [Select]
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.

Here is how I enabled cross-compiling (according to https://forum.lazarus.freepascal.org/index.php/topic,42364.0.html):
1. You need to install libc6-dev-i386 package
2. Use a text editor type: #!/bin/bash <newline> as --32 $@ and save it as /usr/bin/i386-linux-as
3. Use a text editor type: #!/bin/bash <newline> ld -A elf32-i386 $@ and save it as /usr/bin/i386-linux-ld
4. sudo chmod +x /usr/bin/i386-linux-as
5. sudo chmod +x /usr/bin/i386-linux-ld
6. cd /usr/share/fpcsrc/3.0.4
7. sudo make clean all CPU_TARGET=i386
8. sudo make crossinstall OS_TARGET=linux CPU_TARGET=i386  INSTALL_PREFIX=/usr
9. sudo ln -sf /usr/lib/fpc/3.0.4/ppcross386 /usr/bin/ppc386
« Last Edit: November 02, 2018, 07:15:28 pm by Hartmut »

Cyrax

  • Hero Member
  • *****
  • Posts: 615
You need to use -Xd -Fl/usr/lib32 options. Add them end at fpc.cfg file.

Quote
#IFDEF LINUX
  #IFDEF CPU32
    -Fl/usr/lib32
    -Xd
  #ENDIF
#ENDIF

And you need to install 32-bit versions of GTK2 and other libraries. Also you (may) need recompile them with these options : -mstackrealign -mincoming-stack-boundary=2 due to ABI changes in 32-bit libraries. 32-bit FPC doesn't adhere to this ABI change. 64-bit FPC does not have this problem, it produces compatible ABI.

See this bug report for more info : https://bugs.freepascal.org/view.php?id=33425

Hartmut

  • Full Member
  • ***
  • Posts: 210
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 ?

Quote
See this bug report for more info : https://bugs.freepascal.org/view.php?id=33425
I 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?

Cyrax

  • Hero Member
  • *****
  • Posts: 615
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...

You need to consult Ubuntu wiki for how to enable 32-bit repositories and install 32-bit libraries from them. And in this case, how to rebuild your own packages.

Quote
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 ?

Yes.

Quote
Quote
See this bug report for more info : https://bugs.freepascal.org/view.php?id=33425
I 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?

Well, take this as an learning experience!  :D

I would recommend using Linux Containers (LXC or Docker) to experiment on this, so you don't screw up your main OS.

Hartmut

  • Full Member
  • ***
  • Posts: 210
Thanks for your answers. Will follow them tomorrow (sounds difficult for me). Good night...

Hartmut

  • Full Member
  • ***
  • Posts: 210
I spent a lot of time with google'ing for "Ubuntu wiki gtk2 enable 32-bit repositories install 32-bit libraries", "Ubuntu wiki GTK2 32-bit 64-bit", "Ubuntu GTK2 32-bit download" and variants of these. I got a lot of material which was really hard to understand for me as a beginner. But I still don't know, what is my next step:
  • must I "only" find, download and install a 32 bit version of GTK2? If yes, where can I find it?
  • or must I download the sources of GTK2 and compile a 32 bit version by my own and place the result into the right destination folder?

WayneSherman

  • New member
  • *
  • Posts: 49
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

Using Lazarus 1.8.4/FPC 3.0.4 (stable/stable) I just did a test on Xubuntu 18.04 64-bit.  Compiling both 32-bit and 64-bit GUI programs was successful.  Although it compiled successfully, the 32-bit program did not run on Ubuntu 18.04 64-bit using the default installed packages.  But when I copied the 32-bit GUI program to another Linux system it worked.

I started from a minimal Xubuntu 18.04 64-bit install, using
fpcupdeluxe with these steps:

Code: Text  [Select]
  1. 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
  2. sudo apt install -y git subversion make build-essential gdb zip unzip unrar wget
  3.  
  4. # Download "fpcupdeluxe-x86_64-linux" from
  5. # https://github.com/newpascal/fpcupdeluxe/releases/tag/1.6.2c
  6. # Give execute permission to fpcupdeluxe-x86_64-linux and run it.
  7. # Select FPC stable and Lazarus stable and click "Install/update FPC+Laz".
  8. # After that completes select CPU "i386" and OS "linux" and "Install cross-compiler"  (** Select "yes" when missing tools message box appears **)
  9.  
  10. # Run Lazarus from the desktop link created by fpcupdeluxe.
  11. # Create a new GUI project, do a test build for the default 64-bit target and run to make sure it works.
  12. # In Project Options, under Config and Target, change the Target CPU family to "i386".
  13. # Do another Run | Build and it should successfully build a 32-bit executable.
  14. # (you have to run this from a 32-bit Linux OS, or from a 64-bit OS with the proper libraries installed)
« Last Edit: October 23, 2018, 01:57:48 am by WayneSherman »

Hartmut

  • Full Member
  • ***
  • Posts: 210
Thanks a lot for your detailed answer.

I also need to run the 32 bit program on my 64 bit Ubuntu. If I only can cross-compile 32 bit, but cannot run it, this makes no sense in my case. Sorry, that I did not mention that in my 1st question.

# 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)

Please, which are "the proper libraries installed" which I need to run a 32 bit GUI program?
Thanks again for your help.

WayneSherman

  • New member
  • *
  • Posts: 49
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?

Ubuntu is built to use Debian Multiarch which allows installation of packages for multiple CPU architectures on the same OS.  Ubuntu 18.04 64-bit should already be configured for Multiarch and i386, but to confirm:

    #confirm i386 is added as a Multiarch architecture
    dpkg --print-foreign-architectures
    # it should print "i386".
    # If i386 architecture is missing, it can be added like this:
    sudo dpkg --add-architecture i386
    sudo apt update

    apt can be used to install packages for alternate architectures by putting a suffix on the package.
    For example:  sudo apt install package-name:i386

Now you need to 1) find the dependencies, 2) find the packages which contain them, and 3) install the i386 version of those packages:

1) Find the dependencies of your executable
    #Use ldd and/or readelf to list dependencies for an executable.  Before ldd will work with 32-bit executables, you have to install 32-bit libc:
    sudo apt install libc6:i386

    readelf -d /path/to/executable | grep NEEDED
    or
    ldd /path/to/executable
    gives this list:
      linux-gate.so.1 (0xf7f48000)
      libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7f2f000)
      libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7f10000)
      libgdk-x11-2.0.so.0 => not found
      libX11.so.6 => not found
      libgdk_pixbuf-2.0.so.0 => not found
      libgtk-x11-2.0.so.0 => not found
      libgobject-2.0.so.0 => not found
      libglib-2.0.so.0 => not found
      libgthread-2.0.so.0 => not found
      libgmodule-2.0.so.0 => not found
      libpango-1.0.so.0 => not found
      libcairo.so.2 => not found
      libatk-1.0.so.0 => not found
      libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7d32000)
      /lib/ld-linux.so.2 (0xf7f4a000)

2) Find the packages which contain the dependent files

Use dpkg -S filename to search for the packages that contain the missing files.  That gives us this list:
    libgtk2.0-0
    libx11-6
    libgdk-pixbuf2.0-0
    libglib2.0-0
    libpango-1.0-0
    libcairo2
    libatk1.0-0

3) Install the i386 version of the missing packages
    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

Now you should be able to run your 32-bit Lazarus GUI program on 64-bit Ubuntu.
« Last Edit: October 21, 2018, 11:43:19 pm by WayneSherman »

Hartmut

  • Full Member
  • ***
  • Posts: 210
Hello WayneSherman, thank you so much for your detailed and valuable help.

I could run fpcupdeluxe for both steps without any problems and without any errors. You gave me exactly the informations which I needed as a beginner to be successful. You are a great teacher.

Compiling 64-bit works. Cross-compiling 32-bit gives me this error:

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

But I must stop for tonight, will conntinue tomorrow trying to understand/solve this error, if I can. Will report then my result. Thank you very much again.

WayneSherman

  • New member
  • *
  • Posts: 49
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

fpcupdeluxe installs lazarus and fpc into a directory isolated from other Lazarus/FPC installations.
The default install directory is in your users home folder: /home/[user]/fpcupdeluxe
Did you change the default installation location when you ran fpcupdeluxe?

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.
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)?

WayneSherman

  • New member
  • *
  • Posts: 49
I just tested it again and I am now getting "undefined reference" errors also.  Apparently after installing the i386 libraries, some library files are causing the linking to fail.

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

hmm...
« Last Edit: October 23, 2018, 01:54:21 am by WayneSherman »

Hartmut

  • Full Member
  • ***
  • Posts: 210
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.

Quote
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.
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)?
Yes, as you requested in your helpful introductions how to use 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

I did above uninstalls and got then:
Code: [Select]
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

I found a "workaround" for this error:
Code: [Select]
/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.

Now I searched my harddisk for all files beginning with libresolv.so and got:
Code: [Select]
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?

Unfortunately I did not find a solution/workaround for the 2nd error:
Code: [Select]
/usr/lib/i386-linux-gnu//libgio-2.0.so.0: undefined reference to `g_build_filename_valist'

Renaming of "/usr/lib/i386-linux-gnu//libgio-2.0.so.0" did not help. I searched my harddisk for all files beginning with libgio-2.0.so and got:
Code: [Select]
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?

What can I do?

Thaddy

  • Hero Member
  • *****
  • Posts: 7087
No. The core of your problem is that you try a cross-compile from libraries that are actually installed.
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.
In this case the age of the file does not really matter (although fpcdeluxe uses more very old files, they are tested)
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 994
You can try this.

You can point fpcupdeluxe towards your own system 32bit library.
In your case: /lib32
You can also point fpcupdeluxe towards your own system 32bit binary utilities.

If you want to do this.
In setup+ , you can choose your os and cpu in "Custom tools location ..."
And enter your location where to find the bins and the libs.
After setting these locations, you can build the cross-compiler again.

I hope this will work. I do not test this setup very often.

And yes, the libs provided by fpcupdeluxe are old.
Out of all distro's available out there (in 2016), I had to make a single choice ... ;-)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus