FreeBasic Dependencies, GUI, SQLITE - Ubuntu

New to FreeBASIC? Post your questions here.
Post Reply
Mike Green9
Posts: 17
Joined: Jan 05, 2021 20:43
Location: 1000 Islands, Ontario, Canada

FreeBasic Dependencies, GUI, SQLITE - Ubuntu

Post by Mike Green9 »

Hi.

Environment: Ubuntu 20.04 (64 bit).

I have been using QuickBasic with ISAM in DoSBox for many years now, and it is time to upgrade. I’m also an ex Visual Basic User.

My goal is to run Freebasic with a GUI and SQLlite, in Ubuntu. (My IDE is Geany V1.36.)
Please note I would prefer to not have to code in C if possible.

Question re Dependencies
I have downloaded FreeBasic V1.07.

Then I downloaded the freebasic dependencies:
sudo apt-get install gcc-multilib g++-multilib
sudo apt-get install lib32ncurses5-dev
sudo apt-get install libx11-dev:i386 libxext-dev:i386 libxrender-dev:i386 libxrandr-dev:i386 libxpm-dev:i386

When I try to display the fbc version, I get errors:

fbc --version
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for linux-x86 (32bit)
Copyright (C) 2004-2019 The FreeBASIC development team.


How can I ensure that I get the proper 64 bit dependencies?


Questions re GUI
What do I do for a GUI ?
I tried Glade (V3.22) and ended up with an XML file. How do I incorporate the XML code in my FreeBasic program?

Is there a better GUI that I should be using, like CGUI ? Is CGUI built in to FreeBasic, and how do I use it?


Question SQLite
I have installed SQLite Version 3.31.1 (QT Version 5.12.5).
How do I incorporate SQLite commands in my Freebasic program ?


Any help you can give me will be greatly appreciated,
MG..
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: FreeBasic Dependencies, GUI, SQLITE - Ubuntu

Post by badidea »

Mike Green9 wrote: ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for linux-x86 (32bit)
Copyright (C) 2004-2019 The FreeBASIC development team.[/i]
Hi, have have not seen that error before, but looking at this stackoverflow post suggests that sudo apt-get install libgtk3-nocsd0:i386 should fix it.
Mike Green9 wrote: How can I ensure that I get the proper 64 bit dependencies?
Be aware that you installed the 32-bit version of the compiler. If you want, you can install both 32 and 64 bit fbc, but you have to prevent the install script from overwriting the fbc executable (at /usr/local/bin/fbc in my case). E.g. by renaming to fbc32.
Mike Green9 wrote: What do I do for a GUI ?
This List of FreeBASIC GUI libraries/frameworks may help. There is no 'perfect' solution for freebasic.
(The above list followed from this long topic)
Mike Green9 wrote: How do I incorporate SQLite commands in my Freebasic program ?
I have no experience with that.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: FreeBasic Dependencies, GUI, SQLITE - Ubuntu

Post by Xusinboy Bekchanov »

Mike Green9 wrote: Questions re GUI
What do I do for a GUI ?
I tried Glade (V3.22) and ended up with an XML file. How do I incorporate the XML code in my FreeBasic program?
The file contains example on XML:
FreeBASIC-1.07.1-win64\examples\GUI\GTK+\Gtk-3\GtkBuilder_Cairo.bas
Use gtk_builder_new_from_file instead of gtk_builder_new_from_string
Mike Green9 wrote: Is there a better GUI that I should be using, like CGUI ? Is CGUI built in to FreeBasic, and how do I use it?
The folder contains examples on CGUI:
FreeBASIC-1.07.1-win64\examples\GUI\CGUI
Mike Green9 wrote: Question SQLite
I have installed SQLite Version 3.31.1 (QT Version 5.12.5).
How do I incorporate SQLite commands in my Freebasic program ?
The folder contains examples on SQLite:
FreeBASIC-1.07.1-win64\examples\database
Mike Green9
Posts: 17
Joined: Jan 05, 2021 20:43
Location: 1000 Islands, Ontario, Canada

Re: FreeBasic Dependencies, GUI, SQLITE - Ubuntu

Post by Mike Green9 »

Hi.

re Dependencies
I installed FreeBASIC 1.07.1 64 bit:

FreeBASIC compiler successfully installed in /usr/local
fbc --version
FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for linux-x86_64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.

I then re-installed the dependencies which I believe are 64 bit:
sudo apt-get install gcc-multilib g++-multilib
sudo apt-get install lib32ncurses5-dev
sudo apt-get install libx11-dev:i386 libxext-dev:i386 libxrender-dev:i386 libxrandr-dev:i386 libxpm-dev:i386

So far so good.


re GUI
Thanks for the list of FreeBASIC GUI libraries/frameworks.

Does anyone have any examples of code using any of these GUI’s ???


Re SQLite

The folder contains examples on SQLite:
FreeBASIC-1.07.1-win64\examples\database


Silly question but how do I access this folder ?? Is it a website you are referring to ??




Thanks for the responses,
M….
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: FreeBasic Dependencies, GUI, SQLITE - Ubuntu

Post by MrSwiss »

Mike Green9 wrote:Does anyone have any examples of code using any of these GUI’s ???
See: IUP GUI lib (Win/Lin) getting started
Mike Green9 wrote:Silly question but how do I access this folder ?? Is it a website you are referring to ??
It's the 'examples' directory/folder in your FBC installation (typically).
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: FreeBasic Dependencies, GUI, SQLITE - Ubuntu

Post by badidea »

You can also find the sqlite examples here: https://github.com/freebasic/fbc/tree/m ... s/database
Note that many freebasic examples were written a long time ago and not all made compatible with 64-bit yet.
Last edited by badidea on Jan 07, 2021 23:06, edited 1 time in total.
Mike Green9
Posts: 17
Joined: Jan 05, 2021 20:43
Location: 1000 Islands, Ontario, Canada

Re: FreeBasic Dependencies, GUI, SQLITE - Ubuntu

Post by Mike Green9 »

Thank you badidea for sqlite examples.
M....
Post Reply