As of 2017, Developpement environnement setup for Freebasic.

Forum for discussion about the documentation project.
Post Reply
DirectuX
Posts: 4
Joined: Mar 31, 2017 7:26

As of 2017, Developpement environnement setup for Freebasic.

Post by DirectuX »

As of 2017, Developpement environnement setup for Freebasic.

Hello Freebasic community,

I started this thread because after too many forums, documentations and tutorials readings, try and fail setups, I've ended with a mess. So I decided to remove all apps and with help to (re)start with a fresh install.

Development system : windows (8.1)
Target system : windows and linux (optional: others)

Objective :
  • Freebasic compiler
  • Freebasic documentation
  • An editor with autocomplete and unicode support
  • A cross-platform widget toolkit (optional : visual designer; documentation if not) ]
I retained this (march 2017):
Putting it all together :
  • Setup of FreeBasic : ok
  • Documentation of FreeBasic : ok
  • Editor : which one ? criteria = integration with other elements rather than latest improvements; my guess FBIDE ?
  • Cross-platform widget toolkit : which one ?; my guess GTK+ ?
  • How to make it all work together ? settings, path, builds, wrappers, bindings ...


https://www.freebasic.net/ says "The compiler, fbc, currently supports building for i386-based architectures on the DOS, Linux, Windows and Xbox platforms."
It is not clear if from windows I can compile for linux too.

http://www.freebasic.net/wiki/wikka.php ... FAQ#item10 says "For portable programming a multiplatform GUI wrapper library as GTK or wx-Widgets may be used. GTK headers are provided with FB, but the OOP functionality currently available in FB prevents the use of wx-Widgets. The programs created with these libraries may require the user to install the wrapper libraries in their systems."
Am I wrong if I want to program from windows once (GUI+Logic) and compile to linux and windows ?

Acceptance :

According to your guidance, I plan to validate the solution by 1st: running examples from the FreeBASIC\examples\GUI folder, then 2nd: building from scratch a simple graphical helloworld, compile it to windows and linux, run them and post the experience result in this very thread, completed if needed by a tutorial on how to setup this developpement environnement as I would have been glad to find an effective one.

Please : in answers, old topics linking or expressions like "last version" or "I prefer" are not often constructive/helpful.

Looking forward to hear from you
Thanks
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by Tourist Trap »

Hello,

I don't understand this interesting project. Do you plan to benchmark the documentation or something like this?
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by caseih »

Do you have particular questions to ask? If so, state them.

If you download and install the Windows version of the FB compiler, it will not be able to compile binaries that run on Linux. I believe it is possible to build a FB cross compiler from source, which can target Linux from within Windows (or the other way around), but that's really an advanced topic at this stage for you. Probably a virtual machine running a flavor of Linux would be more appropriate when you wish to explore making programs on Linux.

As for GUI toolkits, personal preferences are all you're going to get. Sorry you don't think that's helpful. But there is no one best cross-platform GUI toolkit period, let alone for FB.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by Tourist Trap »

caseih wrote: I believe it is possible to build a FB cross compiler from source, which can target Linux from within Windows (or the other way around), but that's really an advanced topic at this stage for you.
There is a tool published by DJ.Peters at the fb download page that cross compiles from win32 to win64. At least there was some months ago.
DirectuX
Posts: 4
Joined: Mar 31, 2017 7:26

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by DirectuX »

Hello,

-> Tourist Trap

what I've written in short :
me = Freebasic newbie
want = full stack development environment see § Objective in my previous post
done = (a)read, (b)try ... (c)fail, back to (a)
needs = (1) guidance through installation for components until fully working dev environment (2) answers to other questions in my previous post
my contribution = to document here (or elsewhere appropriate) each step to successful achievement
workaround = Since my first post I've tried Ultimate++ and it is working fine out of the box with all features, though it's not basic.

-> caseih

It is not clear if from windows I can compile for linux too. -> ok for the idea of the virtual machine. Thank you.

For the GUI toolkit, I understand the "no-best" situation. That's why I've guessed GTK+ in the precedent post. But Am I wrong if I want to program from windows once (GUI+Logic) and compile to linux and windows ?
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by Tourist Trap »

DirectuX wrote: -> Tourist Trap

what I've written in short
Thanks! That's very clear now. You just expressed the very opinion of maybe 90% of the beginner users and even more advanced.

I was thinking exactly as you do in the past, but since I changed slightly my mind. The purity of Freebasic as a OOP language (because not encumbered with ready made stuff) makes it very good for learning purpose. By comparison VB.net comes with everything already implemented, at many levels, and to say the truth it's just a jungle so you loose the basics.

So for me I take it as it for the moment, and I try to learn as much as possible while this is in this generic state. With more layers, you may add comfort, but also obfuscation of the very principles of programming.

I agree in any way that there is a balance to find and that we need a better IDE... :)
DirectuX
Posts: 4
Joined: Mar 31, 2017 7:26

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by DirectuX »

Tourist Trap wrote:I was thinking exactly as you do in the past, but since I changed slightly my mind. The purity of Freebasic as a OOP language (because not encumbered with ready made stuff) makes it very good for learning purpose. By comparison VB.net comes with everything already implemented, at many levels, and to say the truth it's just a jungle so you loose the basics.

So for me I take it as it for the moment, and I try to learn as much as possible while this is in this generic state. With more layers, you may add comfort, but also obfuscation of the very principles of programming.
Freebasic isn't in cause : the topic is about the setup of all parts in order to work well with each other.
DirectuX wrote:How to make it all work together ? settings, path, builds, wrappers, bindings ...
Until now I have not a working Freebasic setup. My time investment in Freebasic is stopped until I find some help. I have spend too much trying it work by myself. That's why I asked a little help here.
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by St_W »

DirectuX wrote:
  • Setup of FreeBasic : ok
  • Documentation of FreeBasic : ok
  • Editor : which one ? criteria = integration with other elements rather than latest improvements; my guess FBIDE ?
  • Cross-platform widget toolkit : which one ?; my guess GTK+ ?
  • How to make it all work together ? settings, path, builds, wrappers, bindings ...
Regarding the Editor: FBide is very simplistic and nothing for you if you want auto completion. I'd also add poseidonFB (http://freebasic.net/forum/viewtopic.php?f=8&t=23935) to your list in the first post.

Cross-Platform GUI: You may also consider FLTK, see: http://freebasic.net/forum/viewtopic.php?f=14&t=24547
According to other users it seems to be more simple to use than GTK+

How to put it together:
  • set the path to the compiler (fbc.exe) in your IDE
  • For each external library you need according headers and sometimes also a wrapper. You also need the library and optionally an import library for the library.
  • Configure the include-path or the the headers inside a folder in the include-path so that the compiler finds all the include files. see http://freebasic.net/wiki/wikka.php?wakka=CompilerOpti
  • Configure the lib-path or put the libraries inside a folder in the lib-path so that the compiler can find them. If using external libraries get those from the respective 3rd party supplier. You'll need binaries for the platform you are targetting - e.g. 32-bit Windows
    See http://freebasic.net/wiki/wikka.php?wakka=CompilerOptp
Please ask more concrete questions with exact descriptions what you are trying to do and how, to get more detailed answers. Include e.g. error messages or tell us what doesn't work.
DirectuX
Posts: 4
Joined: Mar 31, 2017 7:26

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by DirectuX »

St_W wrote: Regarding the Editor: FBide is very simplistic and nothing for you if you want auto completion. I'd also add poseidonFB (http://freebasic.net/forum/viewtopic.php?f=8&t=23935) to your list in the first post.
Seen, so I picked up FbEdit, and it has autocompletion.
St_W wrote:Cross-Platform GUI: You may also consider FLTK, see: http://freebasic.net/forum/viewtopic.php?f=14&t=24547
According to other users it seems to be more simple to use than GTK+
Ok, let's go with FLTK. I've read that it comes with a graphical tool named FLUID
http://www.fltk.org/index.php wrote:FLTK also includes an excellent UI builder called FLUID that can be used to create applications in minutes.
DOWNLOADS :

from here : http://www.freebasic.net/forum/viewtopi ... =1&t=24363
this:http://downloads.sourceforge.net/fbc/Fr ... p?download and https://downloads.sourceforge.net/fbc/F ... p?download

from here : https://www.freebasic-portal.de/downloa ... de-30.html
this:https://www.freebasic-portal.de/dlfiles ... t1076c.zip

from here : http://laurencejackson.com/win32/
this:http://laurencejackson.com/win32/Win32.chm

INSTALLATION :

Created folders:
  • O:\Freebasic\
  • O:\Freebasic\HelpFiles
In any order:
  • Unzip FreeBASIC-1.05.0-win64.zip in O:\Freebasic\
  • Unzip FbEdit1076c.zip in O:\Freebasic\FBEdit\
  • Move Win32.chm in O:\Freebasic\HelpFiles\
  • Unzip FB-manual-1.05.0-chm.zip in O:\Freebasic\HelpFiles\
Now O:\Freebasic\ contains 3 folders :
  • FBEdit
  • FreeBASIC-1.05.0-win64
  • HelpFiles
CONFIGURATION :

Run O:\Freebasic\FbEdit.exe -> "FbEdit Path Options" dialog box opens
  • Set "Compiler Path" to O:\Freebasic\FreeBASIC-1.05.0-win64
  • Set "Help Path" to O:\FreeBASIC\HelpFiles
then "FbEdit Lite" dialog box opens:
Activate FbEdit Lite for beginners? I choosed "Yes"

Re-run O:\Freebasic\FbEdit.exe ->" FbEdit" window opens
in menu: Options\Help Menu\
  • Set FreeBasic's Command to $H\FB-manual-1.05.0.chm
  • Set Win32's Command to $H\Win32.chm
Now all entries in menu: Help are effective
St_W wrote: set the path to the compiler (fbc.exe) in your IDE
done
St_W wrote: Configure the include-path or the the headers inside a folder in the include-path so that the compiler finds all the include files. see http://freebasic.net/wiki/wikka.php?wakka=CompilerOpti
http://freebasic.net/wiki/wikka.php?wakka=CompilerOpti wrote: By default, fbc searches in the current directory, and prefix/inc--in that order--where, prefix is the location where FreeBASIC is installed.
I left it by default. (I've done nothing about that, is this right ?)
St_W wrote:
  • For each external library you need according headers and sometimes also a wrapper. You also need the library and optionally an import library for the library.
  • Configure the lib-path or put the libraries inside a folder in the lib-path so that the compiler can find them. If using external libraries get those from the respective 3rd party supplier. You'll need binaries for the platform you are targetting - e.g. 32-bit Windows
    See http://freebasic.net/wiki/wikka.php?wakka=CompilerOptp
This will be for FLTK , right ?
But before going further I test if it's working with existing samples:
St_W wrote:Please ask more concrete questions with exact descriptions what you are trying to do and how, to get more detailed answers. Include e.g. error messages or tell us what doesn't work.
I open the first sample provided : O:\Freebasic\FBEdit\Projects\Samples\About\About.bas
and when hitting the green arrow (go) I get this :

Code: Select all

O:\Freebasic\FreeBASIC-1.05.0-win64\fbc -s console "About.bas" "About.rc"
About.bas(53) error 41: Variable not declared, GWL_WNDPROC in 'OldUrlProc=Cast(any ptr,SetWindowLong(GetDlgItem(hWin,IDC_URL),GWL_WNDPROC,Cast(integer,@UrlProc)))'

Build error(s)
Maybe it is just this one,
I open the first example provided : O:\Freebasic\FreeBASIC-1.05.0-win64\examples\compression\bz2compress.bas
and when hitting the green arrow (go) I get this :

Code: Select all

O:\Freebasic\FreeBASIC-1.05.0-win64\fbc -s console "bz2compress.bas"
O:\Freebasic\FreeBASIC-1.05.0-win64\bin\win64\ld.exe: cannot find -lbz2

Build error(s)
I think this should be solved before going through FLTK installation.
By the way, I can't find an FLTK exe I've found just sources in C.

Edit 12 May 2017 : Meanwhile I found this:http://freebasic.net/forum/viewtopic.php?f=14&t=24547 ... will read.
thesanman112
Posts: 538
Joined: Jul 15, 2005 4:13

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by thesanman112 »

Most of the examples are 10 years old, the FB compilier has been updated numerous times so therefore a lot of the examples have to be modified,
even code that I posted years ago wont run anymore. I believe someone should actually remove the examples from the download package. They are excellent examples but they wont run correctly without some modification.
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: As of 2017, Developpement environnement setup for Freebasic.

Post by St_W »

Backwards compatibility has always been an important topic when changes were applied to the compiler. There shouldn't be a lot of changes needed (if any) to run older FB programs in a current 32 bit version of FB. Of course it's different if you want to use 64 bit FB: in that case the chance that you'll have to adapt your code is very likely.
Post Reply