FreeBASIC and the Raspberry Pi ?

General discussion for topics related to the FreeBASIC project or its community.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

srvaldez,
I had given up on the task but seeing as you bothered to respond I tried again this morning.

I have used Build in code::blocks but never knew exactly what it was doing I took it to mean it was compiling the files .c into .exe files

I have done number 5. a few times.

I tried again now and it ended the same way,
E: Failed to fetch http://archive.raspberrypi.org/debian/p ... _armhf.deb Connection timed out [IP: 93.93.135.188 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

However I don't know how to "run apt-get update" where is that?
Nor can I find --fix-missing

And I keep getting the same unable to locate package message with all but libncurses

I downloaded fbc_linux_armv7a_hf_debian_0267_2018-03-08.zip

I double clicked the .zip icon and some window called Xarchiver appeared.
I then created a folder which I named "FreeBASIC" using the File Manager.
So I selected the folder shown "fbc_linux_armv7a_hf_debian" and chose the icon extract files.

Then I tried to carry out the next steps with this result:
pi@raspberrypi:~ $ cd pi\FreeBasic\fbc_linux_armv7a_hf_debian\
> chmod +x ./install.sh
bash: cd: too many arguments
pi@raspberrypi:~ $ chmod +x ./install.sh
chmod: cannot access './install.sh': No such file or directory

So again there is something I am not understanding and don't know what to do about it and maybe will come back later when I have more experience using Linux.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: FreeBASIC and the Raspberry Pi ?

Post by srvaldez »

@BasicCoder2
I don't know how much clearer I can make the instructions if you don't try to follow them :-)
hint: right-click on the FB archive and select extract here
[edit] made some edits on the instructions, hopefully they are unambiguous now :-)
BasicCoder2, don't give up so easily, linux takes a little time to get used to.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

srvaldez wrote:I don't know how much clearer I can make the instructions if you don't try to follow them :-)
But I did follow them as best I could and I posted my exact steps and the results I got. Where are my steps wrong? I typed in exactly what you and others suggested and get responses like "bash: cd: too many arguments". What can I do about that? I copy pasted every step into the command prompt in the order given. If I get "unable to locate package libX11-dev" what can I do about that? And if I get messages such as try "-fix-missing" with the assumption I know what that means all I can do is google google google with the hope I will get an answer. I am currently reading articles on understanding Unix although so far none of it covers any of the issues I have encountered. Honestly it is a complete mystery to me as to why it isn't working.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: FreeBASIC and the Raspberry Pi ?

Post by srvaldez »

@BasicCoder2
libX11-dev worked in the past, but I suspect that now it needs to be all lowercase: libx11-dev
if that works then you may try that on other similar libs and see if it works
tip: you can copy the path of a folder by right-clicking on the folder and selecting copy path, then on the terminal type: "cd " (without the quotes) and then right-click and paste the folder's path
on some versions of linux like Ubuntu you can drag-and-drop a file or folder onto the terminal and the path will be pasted into the terminal, not sure if that functionality is available in Raspbian.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

srvaldez wrote:@BasicCoder2libX11-dev worked in the past, but I suspect that now it needs to be all lowercase: libx11-dev
Thanks that solved that problem it now works. Now to see if I can get Geany and fbc to work together.
I notice that the fbc file is in the bin folder, whereas in Windows it was in the main folder into which it was extracted, and when I double click its icon , a little paper plane, instead of running it pops up a Choose Application Window to open "executable" files??
I assume Geany will need something typed into the Set Build Commands window?
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: FreeBASIC and the Raspberry Pi ?

Post by srvaldez »

you need to install FB as instructed, the executable will be placed in /usr/local/bin and the FBlibs will be placed in /usr/local/lib/freebasic likewise the includes will be placed in /usr/local/include/freebasic
you can't run fbc from the extracted archive, also please re-read the instruction on geany in previous post viewtopic.php?p=244666#p244666
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Re: FreeBASIC and the Raspberry Pi ?

Post by dasyar »

A couple of things to remember: command prompt(Windows)=terminal(Linux), usually it is called the terminal window. In the terminal window you would type In "sudo apt-get update" and NOT "run apt-get update". You have probably figured it out by now, a lot of the stuff gets done in the terminal window, while a lot of stuff gets done in the GUI.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

srvaldez wrote:you need to install FB as instructed,
Ok. So many posts and instructions hard to know which one to follow.
Anyway I chose the first post from dasyar,
Once you extract the .zip file, there is a readme file which gives further explanation as to what to do. One clue, as it happened to me, you will probably have to change the permissions for the install.sh file, just make it "anybody" for all selections.
Not sure how to change the permissions.
However from the readme.txt,
Linux (if FreeBASIC is not available through your package manager):
Download and extract the latest FreeBASIC-x.xx.x-linux.tar.gz. Open a
terminal and cd into the extracted FreeBASIC-x.xx.x-linux directory, and
run "sudo ./install.sh -i" to copy the FB setup into /usr/local.


with this result,
pi@raspberrypi:~ $ cd FreeBasic/fbc_linux_armv7a_hf_debian
pi@raspberrypi:~/FreeBasic/fbc_linux_armv7a_hf_debian $ sudo ./install.sh -i
sudo: ./install.sh: command not found

So i assume here I have to "change the permissions"? Where do I type "anybody" for all selections?
Although I gratefully thank everyone who has replied and tried to help this is an example of where I come unstuck. Do X (change permissions) without any idea how to carry out the command X. Until I learn more about Linux it is simply not in my instruction set.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: FreeBASIC and the Raspberry Pi ?

Post by srvaldez »

chmod +x ./install.sh
sudo sh ./install.sh -i

chmod +x ./install.sh changes the permissions, sudo sh ./install.sh -i installs FB
gothon
Posts: 225
Joined: Apr 11, 2011 22:22

Re: FreeBASIC and the Raspberry Pi ?

Post by gothon »

Yes, it looks like install.sh may not be in the current folder. Type 'pwd' to print the working directory (current folder). To list the contents of the current folder type 'ls' (this is the linux 'dir' command).

You can get a wealth of information on terminal commands by using 'man' to look at the manual page for each command. ex:

Code: Select all

man ls
Though it will probably be easiest if you simply Google for 'linux terminal' to get more experience. Be aware that unlike DOS/windows, to run programs from the current folder you need to prefix the file name with './' as in './MyProg' or './install.sh'. For example once everything is set up, you should be able to use fbc like:

Code: Select all

fbc MyProg.bas
./MyProg
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

@srvaldez,
Success, thank you!!
pi@raspberrypi:~/FreeBasic/fbc_linux_armv7a_hf_debian $ chmod +x ./install.sh
pi@raspberrypi:~/FreeBasic/fbc_linux_armv7a_hf_debian $ sudo sh ./install.sh -i
FreeBASIC compiler successfully installed in /usr/local

Build->Compile
fbc -w all "hello.bas" (in directory: /home/pi/FreeBasic/fbc_linux_armv7a_hf_debian/programs)
Compilation finished successfully.

However when I selected Build->Execute all I got was a window with title "geany_run_script_Q05BGZ.sh"
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: FreeBASIC and the Raspberry Pi ?

Post by srvaldez »

@BasicCoder2
congratulations, to run the program that was successfully compiled click on the gears icon (on some versions it's like a paper plane instead of gears), perhaps you should look at the geany image in this post viewtopic.php?f=17&t=22815&p=199960 it's about halfway down.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC and the Raspberry Pi ?

Post by D.J.Peters »

congratulations too :-)

But what was the reason why you failed while installing the needed packages in the past ?

How do fix it ?

Joshy
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Post by BasicCoder2 »

Firstly it was sudo apt-get install libX11-dev not working because it should have been libx11-dev
Then it was the need to change the permissions for the install.sh file and although dasyar indicated a need earlier I didn't know how to change permissions.

Now I have still not resolved all the issues with compiling and running a program from Geany only that it does now compile. Build/Execute (F5) just pops up a geany_run_script_5ZLBGZ.sh titled window.
Last edited by BasicCoder2 on Mar 23, 2018 15:00, edited 2 times in total.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: FreeBASIC and the Raspberry Pi ?

Post by srvaldez »

@BasicCoder2
geany does not have a quick run F5, you must compile then run your program.
in the picture that you posted I can better tell what icon to click, approximately below Project there's an icon consisting of pyramid with an arrow pointing to a dot - that's your compile button then right below Tools is your Run button.
Post Reply