How I Installed FBC on x86-64 Ubuntu 10.04

Linux specific questions.
Post Reply
DMFNR
Posts: 5
Joined: Sep 29, 2010 11:57
Location: Milwaukee, Wisconsin
Contact:

How I Installed FBC on x86-64 Ubuntu 10.04

Post by DMFNR »

After trying the afecelis's installation guide that is stickied on the top of this forum, I still ran in to a bit of trouble getting FBC up and running on my computer. So after a lot of trial and error, and finally getting a working compiler, I decided I would post a more updated guide for x86-64/AMD64 Ubuntu 10.04 so anyone else who was having problems could get an up and running FreeBASIC compiler (which almost caused me to revert to a 32-bit version and ditch the 4GB extra RAM I have access to just so I could go back to my roots and write some old school BASIC).

First things first, you're going to need to download Getlibs, a program which allows you to download the 32-bit libraries which are missing in x86-64 Ubuntu. You can find it at this website: http://frozenfox.freehostia.com/cappy/. Install with:

Code: Select all

sudo dpkg -i --force-all getlibs-all.deb
Now, you might as well download and install FreeBASIC (regular version, not standalone):

Code: Select all

cd [to dir containing FB]
tar --lzma -xf FreeBASIC-0.21.1-linux.tar.lzma
cd FreeBASIC-0.21.1-linux
sudo ./install.sh -i
Alright, hopefully everything went smooth because now we are going to install the required 32-bit libraries with Getlibs making sure this is all one line (it probably won't display all on one line in the terminal, but you know what I mean, no newlines):

Code: Select all

getlibs -p libxpm-dev libxrandr-dev libxrender-dev libncurses5-dev libx11-dev libsdl1.2-dev libsdl-image1.2 libsdl-image1.2-dev libaa1 libaa1-dev libslang2 libslang2-dev libgpm2 libgpm-dev libgpmg1-dev libglitz-glx1-dev libglut3 libglut3-dev
Provided all of those libraries downloaded and installed properly, the last thing we need to do is get some libraries for GCC. A neat side effect is after this you will also have the ability to compile 32-bit C/C++ programs from your 64-bit system.

Code: Select all

sudo apt-get install libc6-i386 gcc-multilib lib32mudflap0 g++-multilib 
lib32ncurses5 lib32ncurses5-dev
Now make yourself a few test programs using any libraries you might use in your work, and if you come up with any other missing 32-bit libraries, you can always try to find them with getlibs and maybe apt-get if that fails. I've successfully compiled and ran a GTK app and a few simple old school QB style graphics programs since installing and I have a huge smile on my face now.

Coming soon:
A QuickBASIC 4.5 IDE clone for all you old hacks (oops, meant hackers), written in FreeBASIC (55% done) and a modern, full featured IDE for Linux written in Free Pascal/Lazarus which is relatively close to being finished as well, and is coming together quite quick as I need it to continue on with some future projects, and I would like to provide the sorely needed Linux IDE. Geany is good, but I think FBC deserves a dedicated tool. I'd eventually like to port it over to FB as an editor for an eventual Linux RAD tool, but I'd like to see FBC support inheritance someday as it would greatly reduce the amount of code needed to write Lazarus LCL style wrapper classes around the widget sets. I'll probably start work soon anyway as I DO NOT like Glade at all and hand coding GTK apps is a maintainability nightmare...

Have fun, and thank you to the FBC developers and community for this awesome tool, and for saving me from trying to resurrect LBCC from the dead...
richardpd
Posts: 6
Joined: Nov 21, 2010 10:16

FBC issues in Ubuntu10.04

Post by richardpd »

Hi DMFNR
Thanks for your helpful post.
I have/had(?!) an issue with FBC compile in Ubuntu10.04 see my forum post of today at:
http://www.freebasic.net/forum/viewtopi ... 515#148515

I followed your post instructions & still get libncurses error.
I think I also have FBC standalone & normal installed together as I was unable to uninstall either earlier. I may try again but as compile & run seem to work apart from the libncurses error message I may have to accept this as it is!?!
I have already spent a lot of time trying to get this to work on Ubuntu10.04 and as a linux & FBC newbie it is hard!!

Any comment gratefully received-thanks again for your fine post!
tinram
Posts: 89
Joined: Nov 30, 2006 13:35
Location: UK

Post by tinram »

Thank you DMFNR - a really informative and detailed post.

The only difference I encountered on repeating your instructions step-by-step on Mint x86-64 was: install.sh aborted, complaining about the prefix
unable to determine the configured prefix from ./fbc -version

So I skipped the fbc installation, installed the 32-bit libraries with getlibs as you detailed further on, and executed install.sh again (as the last step) - which then installed with no issues.

Like richardpd mentioned, I get the libcurses warning from the linker, on compilation, although the programs I've compiled so far run fine.
ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib32/libncurses.so when searching for -lncurses
ChipDSnow
Posts: 3
Joined: Jan 11, 2011 2:29

Library error

Post by ChipDSnow »

I followed the steps outlined, and I'm still getting an error.

It says:

chip@chip-laptop:/media/1TBHD$ fbc helloworld.bas
helloworld.bas() error 24: File not found, libsupc++.a
ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc.a when searching for -lgcc
ld: cannot find -lgcc

Any help would be helpful. Thanks!!
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Post by Galeon »

ChipDSnow: make sure you have g++-multilib installed using apt-get:
sudo apt-get install g++-multilib
ChipDSnow
Posts: 3
Joined: Jan 11, 2011 2:29

Thank you

Post by ChipDSnow »

Galeon: Thank you for your help on the first issue that I was having. I did what you said, and it cleared up that error. Now I am getting this annoying little error:

chip@chip-laptop:/media/1TBHD$ fbc HelloWorld.bas
ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib32/libncurses.so when searching for -lncurses


I'm starting to get frustrated using this program, but it's the only one that my father uses, and I would like to be able to throw some code around with him.

Again, thanks for your help and looking forward to hearing from you again.

Chip D. Snow
Landeel
Posts: 777
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Post by Landeel »

Make sure you have installed lib32ncurses or lib32ncurses5.

If you have already installed it, do the following:

Find a file called "elf_i386.x". In the standalone version, it's in "/usr/share/freebasic/lib/linux/". Edit this file, and change the "SEARCH_DIR", so it will look up for 32-bit libraries first. It must look like this:

Code: Select all

SEARCH_DIR("/usr/local/lib32"); SEARCH_DIR("/lib32"); SEARCH_DIR("/usr/lib32");SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
ChipDSnow
Posts: 3
Joined: Jan 11, 2011 2:29

Thank you, thank you, thank you...

Post by ChipDSnow »

I'm not sure what I did, but whatever it was, you helped.

Thank you, thank you, thank you!!

Chip D. Snow
Pottersson
Posts: 25
Joined: Jun 13, 2008 17:10

THANK YOU!

Post by Pottersson »

THANK YOU!

I've been struggling for a long time now to get FB to run on my laptop -- for awhile, I'd even downgraded to 32 bit Ubuntu even though it meant not using all 4GB of my RAM.

BTW, are there any plans for making a .deb package for FB?
vdecampo
Posts: 2992
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Post by vdecampo »

I was having trouble with FreeBASIC working on my Ubuntu 11.04 64-bit. I downloaded the tarball installation but I was getting an error regarding libncurses. I fixed it by going into Synaptic Package Manager and downloading the lib32ncurses-dev package. Works good so far!

-Vince
Post Reply