Linker error

Linux specific forum
Martin Verlaan
Enthusiast
Enthusiast
Posts: 124
Joined: Sun Apr 01, 2018 11:26 am

Linker error

Post by Martin Verlaan »

I'm trying to compile my application with the x86 compiler on my 64bit pc. With x64 compiler i have no problems but with x86 version I get this error:

/usr/bin/ld: skipping incompatible /var/data/purebasic-32bit/purelibraries/linux/libraries/libpbsqlite3.a when searching for -lpbsqlite3
/usr/bin/ld: cannot find -lpbsqlite3
collect2: error: ld returned 1 exit status

How can I solve this?
Martin Verlaan
Enthusiast
Enthusiast
Posts: 124
Joined: Sun Apr 01, 2018 11:26 am

Re: Linker error

Post by Martin Verlaan »

When I try to compile a simple one line program (without sqlite) I get even more errors:

/usr/bin/ld: i386 architecture of input file `purebasic.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/var/data/purebasic-32bit/compilers/debugger.a(Debugger.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/var/data/purebasic-32bit/compilers/debugger.a(ThreadSupport.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/var/data/purebasic-32bit/compilers/debugger.a(UnicodeSupport.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/var/data/purebasic-32bit/compilers/debugger.a(ConsoleDebugger.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/var/data/purebasic-32bit/compilers/debugger.a(ExternalDebugger.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/var/data/purebasic-32bit/compilers/debugger.a(ExpressionParser.o)' is incompatible with i386:x86-64 output
...
collect2: error: ld returned 1 exit status

:-(
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Linker error

Post by Shardik »

On Windows and MacOS it's working like a charm to compile a program with a x86 PB compiler on a x64 machine (MacOS even doesn't have separate x86 and x64 versions). But on Linux it's very tricky and requires to install x86-compatability libraries beneath the x64 libraries. You may take a look into this old sticky thread "Using PureBasic (32bit) on 64bit Linux" and freak's guide but I would recommend to install both a x86 and x64 version in a multi-boot environment or install them as virtual machines. It's much less of a hassle... :wink:
Martin Verlaan
Enthusiast
Enthusiast
Posts: 124
Joined: Sun Apr 01, 2018 11:26 am

Re: Linker error

Post by Martin Verlaan »

Thanks for your quick reply. I followed the guide but without success. So I followed your advice and installed Mint-x86 in a VirtualBox and now it's compiling without errors.
Post Reply