Sample programs
Sample programs
Trying to run the examples that come with FreeBASIC-1.05.0-win64.
Most of them don't seem to work or am I doing something wrong. Seems a lot of #Include .bi files are not found.
Most of them don't seem to work or am I doing something wrong. Seems a lot of #Include .bi files are not found.
-
- Posts: 2958
- Joined: Jun 02, 2015 16:24
Re: Sample programs
Edit ;)JLWest wrote:Trying to run the examples that come with FreeBASIC-1.05.0-win64.
Most of them don't seem to work or am I doing something wrong. Seems a lot of #Include .bi files are not found.
More than a discourse, what example do you try to launch so I could try here (or anyone)? I also just installed fb64 for windows.
Re: Sample programs
Probably the latter ;-)JLWest wrote:Most of them don't seem to work or am I doing something wrong.
Could you tell us an example for an error message you got?
Also note that many examples demonstrate the use of third-party components with FreeBasic. Of course those samples won't work without installing the respective third party components appropriately.
If that is the problem maybe this FAQ entry could help you: https://freebasic.net/wiki/wikka.php?wa ... FAQ#item25
Re: Sample programs
If that is the case, then surely there is a line on top of the example saying "before compiling this, install xyz from http://www...St_W wrote:Of course those samples won't work without installing the respective third party components appropriately
Re: Sample programs
Yes, of course, as soon as you (personally), have converted, all of those files! <laugh, loud>jj2007 wrote:... then surely there is a line on top of the example saying ...
Re: Sample programs
For examples that I have written myself, I do that, see e.g.Printing a sinus via the FPU, the CRT, the GSL, and Python. Authors who are writing for a language called "Beginner's All-purpose Symbolic Instruction Code" should do that IMHO.MrSwiss wrote:Yes, of course, as soon as you (personally), have converted, all of those files! <laugh, loud>jj2007 wrote:... then surely there is a line on top of the example saying ...
Re: Sample programs
I've read that particular comment from you before (at least once).
Let me quickly explain, how it "comes across":
will always have "precedence", over ideas from others.
Btw: We are talking about very old code, as in FB's samples which, may not even run,
with current FB compiler's.
Let me quickly explain, how it "comes across":
- I want to have changed (whatever, according to my idea)
- however, I don't want to do it myself ...
will always have "precedence", over ideas from others.
Btw: We are talking about very old code, as in FB's samples which, may not even run,
with current FB compiler's.
Re: Sample programs
Let's see what problem the OP is actually facing. IMHO the examples make clear when non-standard components are used (and if not, at least the linker error does so, and is explained in the FB FAQ).
And yes, practically all samples are very old and some may still have 64-bit compatibility issues.
And yes, practically all samples are very old and some may still have 64-bit compatibility issues.
-
- Posts: 3906
- Joined: Jan 01, 2009 7:03
- Location: Australia
Re: Sample programs
Just because the example code "comes with" the latest version of FreeBASIC does not mean they were written to run with the latest version of FreeBASIC. You may have to use the version of FreeBASIC that existed when the code was written. Also I think win64 can even make that buggy. I have old FreeBASIC code I cannot run anymore and it would be easier to rewrite them rather than try and modify them for the latest FreeBASIC compiler. That is just part of how it is in the modern programming world for all languages. For example I am using SDL2 and simply ignore code examples written for SDL. If the code will not compile just forget about it until you are advanced enough to modify it should it still be of interest.JLWest wrote:Trying to run the examples that come with FreeBASIC-1.05.0-win64.
Most of them don't seem to work or am I doing something wrong. Seems a lot of #Include .bi files are not found.
The include files may also not be compatible with the current latest of FreeBASIC?
If you can't find a .bi file try searching for it with google.
Last edited by BasicCoder2 on Jan 15, 2018 21:15, edited 2 times in total.
Re: Sample programs
I don't agree on that; the samples that are shipping with FreeBasic are intended to work with that version and are adapted to work with the latest versions, in case something breaks. If something doesn't work please submit a bug report.BasicCoder2 wrote:Just because the example code "comes with" the latest version of FreeBASIC does not mean they were written to run with the latest version of FreeBASIC.
-
- Posts: 3906
- Joined: Jan 01, 2009 7:03
- Location: Australia
Re: Sample programs
Well I stand corrected. I didn't know that someone was making sure that was the case.St_W wrote:I don't agree on that; the samples that are shipping with FreeBasic are intended to work with that version and are adapted to work with the latest versions, in case something breaks. If something doesn't work please submit a bug report.BasicCoder2 wrote:Just because the example code "comes with" the latest version of FreeBASIC does not mean they were written to run with the latest version of FreeBASIC.
Re: Sample programs
I don't want to claim that someone actively checks all the samples for each release (although I've written a tool some time ago to do that: https://bitbucket.org/st_w/fb-jenkins/s ... ?at=master ), but they are definitly intended to work with the FreeBasic version they are shipping and bugs are fixed if they are detected. It just may happen that bugs remain undetected, so I just would like to encourage anyone to report a problem when it is found. And don't be afraid in case it later turns out that the problem is caused by some other error (e.g. a user error) - nobody will be blamed ;-) (that doesn't mean that you shouldn't check for potential other errors first yourself as far as you are able to, though)BasicCoder2 wrote:Well I stand corrected. I didn't know that someone was making sure that was the case.
Re: Sample programs
Thanks for the reply's. I'll give it another try.
Trying to learn all this is like drinking from a fir hose.
I would like to bugle a simple windows application, really find it difficult to get started.
Trying to learn all this is like drinking from a fir hose.
I would like to bugle a simple windows application, really find it difficult to get started.
Re: Sample programs
You have to remember I'm a novice to this with limited programming experience.
1. Tried biz2compress.ba in FreeBASIC-1.05.0-win64\examples\compression\biz2compress.bas
"F:\FreeBASIC-1.05.0-win64\fbc.exe" "F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas"
Compiler output:
F:\FreeBASIC-1.05.0-win64\bin\win64\ld.exe: cannot find -lbz2
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win64 (64bit)
OS: Windows NT 6.2 (build 9200)
2. libzip.bas in FreeBASIC-1.05.0-win64\examples\compression\libzip.bas
This one has more hangups than a walk in closet.
3. quicklz.bi in FreeBASIC-1.05.0-win64\examples\compression\ quicklz.bi
"F:\FreeBASIC-1.05.0-win64\fbc.exe" "F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas"
Compiler output:
F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas(4) error 23: File not found, "quicklz.bi" in '#include "quicklz.bi"'
Results:
Command executed:
"F:\FreeBASIC-1.05.0-win64\fbc.exe" "F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas"
Compiler output:
F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas(4) error 23: File not found, "quicklz.bi" in '#include "quicklz.bi"'
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win64 (64bit)
OS: Windows NT 6.2 (build 9200)
Compiler output:
F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas(4) error 23: File not found, "quicklz.bi" in '#include "quicklz.bi"'
4. zlib in FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win64 (64bit)
lots of errors.
I got to be doing something wrong. None of the programs in FreeBASIC-1.05.0-win64\fbc.exe" "F:\FreeBASIC-1.05.0-win64\examples\ will compile.
Is there an order they have to be compiled?
1. Tried biz2compress.ba in FreeBASIC-1.05.0-win64\examples\compression\biz2compress.bas
"F:\FreeBASIC-1.05.0-win64\fbc.exe" "F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas"
Compiler output:
F:\FreeBASIC-1.05.0-win64\bin\win64\ld.exe: cannot find -lbz2
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win64 (64bit)
OS: Windows NT 6.2 (build 9200)
2. libzip.bas in FreeBASIC-1.05.0-win64\examples\compression\libzip.bas
This one has more hangups than a walk in closet.
3. quicklz.bi in FreeBASIC-1.05.0-win64\examples\compression\ quicklz.bi
"F:\FreeBASIC-1.05.0-win64\fbc.exe" "F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas"
Compiler output:
F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas(4) error 23: File not found, "quicklz.bi" in '#include "quicklz.bi"'
Results:
Command executed:
"F:\FreeBASIC-1.05.0-win64\fbc.exe" "F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas"
Compiler output:
F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas(4) error 23: File not found, "quicklz.bi" in '#include "quicklz.bi"'
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win64 (64bit)
OS: Windows NT 6.2 (build 9200)
Compiler output:
F:\FreeBASIC-1.05.0-win64\examples\compression\FBIDETEMP.bas(4) error 23: File not found, "quicklz.bi" in '#include "quicklz.bi"'
4. zlib in FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win64 (64bit)
lots of errors.
I got to be doing something wrong. None of the programs in FreeBASIC-1.05.0-win64\fbc.exe" "F:\FreeBASIC-1.05.0-win64\examples\ will compile.
Is there an order they have to be compiled?
Re: Sample programs
These compression files need the associated library files (dll or .a) which should be downloaded separately.
quicklz.bi seems to be in the 32 bit inc folder.
64 bit FreeBASIC is relatively new.
Try examples\GUI\win32\calendar.bas.
This uses the windows built in libraries.
You'll soon get the hang of it.
Some of the examples\graphics should run straight off.
quicklz.bi seems to be in the 32 bit inc folder.
64 bit FreeBASIC is relatively new.
Try examples\GUI\win32\calendar.bas.
This uses the windows built in libraries.
You'll soon get the hang of it.
Some of the examples\graphics should run straight off.