FreeBASIC 1.09.0 Release

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
adeyblue
Posts: 299
Joined: Nov 07, 2019 20:08

Re: FreeBASIC 1.09.0 Release

Post by adeyblue »

I doubt this was introdced with any recent changes, and it's not that big of an issue, but I've managed to make a recursive macro that crashes the compiler.

Code: Select all

#macro Hi()
#define NewMacro __FB_JOIN__(NewMacro, x)
'' NewMacro '' this produces the recursive define compile error

'' this crashes
Type NewMacro

End Type
#endmacro

Hi()
It has to be inside the #macro. Removing that gives you the compile error
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: FreeBASIC 1.09.0 Release

Post by Munair »

caseih wrote:Yes this has been brought up before. The answer is that nearly all distros ship a ncurses compatibility library that supplies this older version of the library. On Manjaro, look for a package called ncurses5-compat-libs. Might need to us an AUR for that. Debian, Ubuntu, Fedora, all offer a similar package.
What version of ncurses is required for FBC 1.08? On my system, ncurses5-compat-libs is indeed in the AUR, but not installed. I'm careful with AUR packages as they can sometimes make the system unstable.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: FreeBASIC 1.09.0 Release

Post by caseih »

I don't know about 1.08. Right now the oldest, supported Linux distros such as CentOS 7 use ncurses 5, so if a pre-built package wants to support the most number of distros they use that version, and like I said most distros provide a compatibility library package to support such binaries. In your case ncurses5-compat-libs is what you want. It certainly won't affect your system stability. It merely provides this older version of the shared library, which coexists with ncurses 6.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: FreeBASIC 1.09.0 Release

Post by Munair »

caseih wrote:In your case ncurses5-compat-libs is what you want. It certainly won't affect your system stability. It merely provides this older version of the shared library, which coexists with ncurses 6.
AUR packages are not binaries; they have to be built and I am generally careful with that. There are ways to get FBC 1.09 running on Manjaro for sure, but I'll wait for the repo update.
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: FreeBASIC 1.09.0 Release

Post by operator+ »

fbc is very portable. I could put both the compiler and the IDE on an USB stick and use it from there. The compiled binary is just run and doesn't need any extra DLLs. Thank you coderJeff very much.
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.09.0 Release

Post by coderJeff »

Munair wrote:Yes, but I wanted to inform the developers of this issue.
The default linux binaries are built on ubuntu-16.04 so the compiler links with (now) older libraries. There are other versions of ubuntu also.
Some distros seem to have maintainers that build fbc for the distro - which is best practice imho. I don't keep up to date with which distros have their own builds. fbc's bootstrap-source package can be a good start to building your own fbc if there is a bootstrap version that is close enough to build on your distro of choice.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: FreeBASIC 1.09.0 Release

Post by Munair »

coderJeff wrote:Some distros seem to have maintainers that build fbc for the distro - which is best practice imho.
That is the case with Manjaro. They're usually pretty quick with updating packages.
Chris_D
Posts: 2
Joined: Jan 10, 2022 17:12

Re: FreeBASIC 1.09.0 Release

Post by Chris_D »

I found this thread by searching this forum for "Debian". My problem is that on Debian I get this error when running fbc:
fbc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
That library is on my system at /usr/lib/x86_64-linux-gnu/libtinfo.so.5

I installed the dependencies specified in readme.txt:
To compile FB programs, please install the following packages (names may
vary depending on your Linux distribution):
Debian/Ubuntu:
gcc libncurses5-dev libffi-dev libgl1-mesa-dev
libx11-dev libxext-dev libxrender-dev libxrandr-dev libxpm-dev
libtinfo5 libgpm-dev
Is there a solution or shall I give up?

Chris D
funlw65
Posts: 8
Joined: Jun 20, 2010 22:15
Contact:

Re: FreeBASIC 1.09.0 Release

Post by funlw65 »

Chris_D wrote:I found this thread by searching this forum for "Debian". My problem is that on Debian I get this error when running fbc:
fbc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
That library is on my system at /usr/lib/x86_64-linux-gnu/libtinfo.so.5

I installed the dependencies specified in readme.txt:
To compile FB programs, please install the following packages (names may
vary depending on your Linux distribution):
Debian/Ubuntu:
gcc libncurses5-dev libffi-dev libgl1-mesa-dev
libx11-dev libxext-dev libxrender-dev libxrandr-dev libxpm-dev
libtinfo5 libgpm-dev
Is there a solution or shall I give up?

Chris D
See if that path is missing from /etc/ld.so.conf file (or the others referred by it, but I doubt it is the case)... if not, add it and then launch ldconfig again.
Chris_D
Posts: 2
Joined: Jan 10, 2022 17:12

Re: FreeBASIC 1.09.0 Release

Post by Chris_D »

Thank you for your reply.

I tried adding the /usr/lib/x86_64-linux-gnu/ path to the end of /etc/ld.so.conf and ran ldconfig. fbc still gives the same error.

I also tried writing the full /usr/lib/x86_64-linux-gnu/libtinfo.so.5 file name into /etc/ld.so.conf and that didn't work either.

For now, it seems to me that my best option is to use QB64, which I don't like but at least it works.
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.09.0 Release

Post by coderJeff »

Chris_D wrote:I found this thread by searching this forum for "Debian". My problem is that on Debian I get this error when running fbc:
fbc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Which fbc package did you download?
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC 1.09.0 Release

Post by D.J.Peters »

I get wrong results here
is binary file reading changed ?

the first 4 bytes in the file are:
ascii "QSHd" or decimal 81,83,72,100 but in the readed buffer it is 81,1,24,0

EDIT: this was with fbc64.exe
The result of fbc32.exe are: 81,0,150,0

Joshy

I mean simple code like this:

Code: Select all

const fileName = "guitarra.QSF"
var hFile = FreeFile()
if open(fileName,for binary,access read,as hFile) then
  print "error: can't read: '" & fileName & "' !"
  beep:sleep:end 1
end if
var nBytes = lof(hFile)
print "file size: " & nBytes
dim as ubyte ptr fileBuffer=allocate(nBytes)
get #hFile,,*fileBuffer
close hFile
D:\>FreeBASIC\fbc32.exe --version
FreeBASIC Compiler - Version 1.09.0 (2021-12-31), built for win32 (32bit)
Copyright (C) 2004-2021 The FreeBASIC development team.
standalone

D:\>FreeBASIC\fbc64.exe --version
FreeBASIC Compiler - Version 1.09.0 (2021-12-31), built for win64 (64bit)
Copyright (C) 2004-2021 The FreeBASIC development team.
standalone
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC 1.09.0 Release

Post by fxm »

get #hFile,,*fileBuffer,nBytes
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC 1.09.0 Release

Post by D.J.Peters »

[solved] looks like nBytes isn't optional :-)

Maybe fbc should print out a warning ?

get #hFile,,*fileBuffer,nBytes

Joshy
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC 1.09.0 Release

Post by fxm »

How the compiler can guess your number of bytes (> 1) to read, by passing it a dereferenced byte pointer corresponding to one byte, therefore why a warning?
Post Reply