PB 5.7 Beta Linker error

Linux specific forum
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

PB 5.7 Beta Linker error

Post by collectordave »

Clean Install of PB 5.7 Beta on UBUNTU.

Compiler runs Ok compiling the lines of code then reports a linker error as below:-

/home/dave/Programmes/purebasic/purelibraries/linux/libraries/libpbsqlite3.a(sqlite3.o): In function `backupOnePage.isra.517':
sqlite3.c:(.text+0x42a0a): undefined reference to `__divmoddi4'
collect2: error: ld returned 1 exit status

Any Ideas?

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
deeproot
Enthusiast
Enthusiast
Posts: 271
Joined: Thu Dec 17, 2009 12:00 pm
Location: Llangadog, Wales, UK
Contact:

Re: PB 5.70 Beta Linker error

Post by deeproot »

I have just hit exactly the same problem - cannot see any obvious cause :(

Details:-
Fresh install of PureBasic 5.70 beta 4 x86
Running on MX Linux 17 32-bit with all latest updates installed.
./checkinstall.sh runs with no issues found.
My error message:
/home/geoff/purebasic570/purebasic/purelibraries/linux/libraries/libpbsqlite3.a(sqlite3.o): In function `backupOnePage.isra.517':
sqlite3.c:(.text+0x42a0a): undefined reference to `__divmoddi4'
collect2: error: ld returned 1 exit status
interesting things:
PureBasic 5.62 x86 is installed in a separate directory of same computer - runs fine and compiles the same source files with no problem.
On a different machine I have PureBasic 5.70 beta 4 x64, running under MX Linux 17 64-bit - same source files compile with no problem (many times in fact! this is my main Linux dev system).

BTW - for anyone who doesn't know, MX Linux is a Debian based distro. PureBasic versions usually install fine with no fuss.
deeproot
Enthusiast
Enthusiast
Posts: 271
Joined: Thu Dec 17, 2009 12:00 pm
Location: Llangadog, Wales, UK
Contact:

Re: PB 5.7 Beta Linker error

Post by deeproot »

Same issue for PB 5.71 LTS

After a long break I've just got back to some coding and installed 5.71LTS on a couple of systems. Unfortunately, with Linux 32-bit the linker error above still exists.

Not sure if this is a valid solution? - but it can be fixed by replacing libpbsqlite3.a with the same file from an installation of PB 5.62 x86. My program then compiles fine and when tested everything appears to be working (with a lot of SQLite stuff!).

I believe, after reading another thread, the linker problem can also be avoided with UseSQLiteDatabase(lib-file) to load an external library.

So it's not such a bad problem. However, it seems a pity that 5.71 x86 does not work "out of the box" when using SQLite :?

As with 5.70, there is no problem with 5.71 x64

(Edit: I'd just like to add - on my systems the 5.71 IDE appears to be much more stable than previous versions. Not one crash so far - great!)
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: PB 5.7 Beta Linker error

Post by Shardik »

deeproot wrote:Unfortunately, with Linux 32-bit the linker error above still exists.
This is not true in general for all 32-bit Linux distributions. I have tested PureBasic's example program from the help for UseSQLiteDatabase() with the following 32-bit Linux distributions and PB 5.71 x86 with default GTK3 (a minus sign denotes that PB 5.71 x86 on the specified distribution terminates on execution of UseSQLiteDatabase() with the error message posted by deeproot):
[-] Bodhi Linux 4.5.0 x86 with Moksha
[+] Debian 10 x86 'Buster' with LXDE
[-] Kubuntu 16.04 x86 with KDE
[+] Kubuntu 18.04 x86 with KDE
[+] Linux Mint 19 x86 'Tara' with Cinnamon
[-] Lubuntu 16.04 x86 with LXDE
[+] Lubuntu 18.04 x86 with LXDE
[-] MX Linux 18.3 x86 'Continuum' with Xfce
[+] Q4OS 3.8 x86 with Trinity
[-] Ubuntu 16.04 x86 with Unity
[+] Ubuntu 18.04 x86 with Gnome 3 and default Unity theme
[+] Ubuntu Budgie 18.04 x86 with Budgie
[-] Ubuntu MATE 16.04 x86 with MATE
[+] Ubuntu MATE 18.04 x86 with MATE
[-] Xubuntu 16.04 x86 with Xfce
[+] Xubuntu 18.04 x86 with Xfce

All older distributions based on Ubuntu 16.04 x86 LTS (which is supported by Canonical until March 2021) terminate on execution with the error message posted by deeproot. The error might indeed be circumvented by using libpbsqlite3.a from a PB 5.62 installation:

Code: Select all

UseSQLiteDatabase("Path/to/PB_5.62_Home/purelibraries/linux/libraries/libpbsqlite3.a")
Last edited by Shardik on Fri Oct 04, 2019 10:10 am, edited 2 times in total.
deeproot
Enthusiast
Enthusiast
Posts: 271
Joined: Thu Dec 17, 2009 12:00 pm
Location: Llangadog, Wales, UK
Contact:

Re: PB 5.7 Beta Linker error

Post by deeproot »

Thanks Shardik - very good information!

I clearly need to find more computer and disk space to load extra distos :mrgreen:

The issue above was on MX Linux 18.3 x86. I have Mint and Manjaro for testing only, but 64-bit.
User avatar
mk-soft
Always Here
Always Here
Posts: 5405
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB 5.7 Beta Linker error

Post by mk-soft »

The problem is that Ubuntu v19.x and others are using the new kernel and compilers.
For some reason unknown to me, so much has been changed that many have to adapt their programs.

Constants names changed, functions removed and created with new names, etc..
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply