Where can I get a Recent-Git-Build of FreeBASIC?

For other topics related to the FreeBASIC project or its community.
dkl
Site Admin
Posts: 3212
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby dkl » May 22, 2014 9:56

Byval As String is now implemented "properly". In older versions it's just a Byval As Zstring Ptr, but now it's implemented by passing a pointer to a temporary FBSTRING descriptor, to get the true Byval semantics.

I guess it's now incompatible to VisualBasic's Byval As String? It should work again by declaring the parameter as Byval As Zstring Ptr on the FB side.
maxarg
Posts: 7
Joined: May 21, 2014 7:09

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby maxarg » May 22, 2014 11:23

Thank You,
this works fine!

Public Function TEST_DLL StdCall (ByVal dllName As ZString Ptr) As Any Ptr Export
Return DylibLoad(*dllName)
End Function
counting_pine
Site Admin
Posts: 6225
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby counting_pine » May 22, 2014 11:52

Byref As Zstring should also work, if you don't want to have to change the function to use pointers internally.
dodicat
Posts: 6687
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby dodicat » May 22, 2014 13:46

In some circumstances, Byval as string seems to be slower than byref as string then using a copy to preserve the string.

Code: Select all

function f(byval s as string) as string
    s+=" BYVAL"
    function= s
end function

function f2(byref s as string) as string
    dim as string copy=s
    copy+=" BYREF"
    function= copy
end function

dim as string g="0123456789"
dim as string ans
dim as integer limit=2000000

dim as double t1
t1=timer
for z as integer=1 to limit
ans=f(g)
next z
print ans
print "Original "; g
print "Time taken ";timer-t1
print
sleep 50
t1=timer
for z as integer=1 to limit
ans=f2(g)
next z
print ans
print"Original "; g
print "Time taken "; timer-t1
print "Done"
sleep

 


Also, passing a fixed length string to a function was never a freebasic option, the suggested course of action was:

Quote from help file ---

A ZString is a C-style fixed-size array of chars. It has no descriptor so its length is calculated faster to pass it as an argument to functions. When the variable has a fixed size, FreeBASIC avoids any overflow that could occur on assignment, by truncating the contents to a length of size - 1

But the Recent Build still gives the same strange result when tested:

Code: Select all


sub dothis(z() as zstring * 3)
for n as integer=lbound(z) to ubound(z)
    z(n)="qb"
next n
print "________________"
print
end sub

dim as zstring * 3 p(6)

for n as integer=0 to 6
    p(n)="fb"
    print n, ">";p(n);"<"
    next n

dothis(p())


for n as integer=0 to 6
    print n,">";p(n);"<"
next n
print
sleep

 
dkl
Site Admin
Posts: 3212
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby dkl » May 22, 2014 13:59

Yea, z/w/string * N parameters aren't working yet, not even if they're array parameters - the N is simply ignored and assumed to be 1. I.e. strictly speaking FB is writing the string data into the array, it's just that it's truncated (only 1 byte per string, i.e. only the null terminator) and at the wrong offsets (0, 1, 2, ... instead of 0, 3, 6, ...). Also see #650.

Code: Select all

sub dothis(z() as zstring * 3)
   for n as integer=lbound(z) to ubound(z)
      z(n)="qb"
   next
end sub

dim as zstring * 3 p(6)
const ARRAYSIZE = sizeof(p(0)) * (ubound(p) - lbound(p) + 1)

for n as integer = 0 to 6
   p(n)="fb"
next

scope
   var p = cptr(ubyte ptr, @p(0))
   for i as integer = 0 to ARRAYSIZE-1
      print hex(p[i], 2);" ";
   next
   print
end scope

print string( 50, "-" )
dothis(p())

scope
   var p = cptr(ubyte ptr, @p(0))
   for i as integer = 0 to ARRAYSIZE-1
      print hex(p[i], 2);" ";
   next
   print
end scope
fxm
Posts: 9946
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby fxm » May 28, 2014 6:07

St_W wrote:The mingw package should contain everything that is needed to compile a freebasic program except Microsoft C Runtime.

Why not add just the folder inc\crt at http://users.freebasic-portal.de/stw/builds/?
St_W
Posts: 1504
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby St_W » May 28, 2014 13:09

I did not mean the FreeBasic Headers for using the Microsoft C Runtime library, but the runtime library itself. It is located in MSVC... DLLs in the %windir%\System32 folder - MinGW links to the default Microsoft C Runtime library "MSVCRT.DLL", which is an integral part of each Windows installation anyway, as far as i know.

Anyway, should I include the inc/crt folder or other FreeBasic Headers? (I haven't included most of them because the package size would grow by several MB).
_____

Btw: I've extended the publishing job to upload a changelog which contains information about which commits are included in which build. The information is directly taken from Jenkins, with unneccessary headers/footers/etc. removed.
aloberoger
Posts: 495
Joined: Jan 13, 2009 19:23

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby aloberoger » Jun 10, 2014 8:00

strange error while compiling some projects:
C:\fbc_win32_mingw\bin\win32\ld.exe: invalid subsystem type Gui
St_W
Posts: 1504
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby St_W » Jun 10, 2014 14:17

Hm, could you post the verbose compiler output for such a project, please? (add command line option "-v")

Does it work with the "ld.exe" included in FreeBasic Release Packages? (-> Download)
aloberoger
Posts: 495
Joined: Jan 13, 2009 19:23

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby aloberoger » Jun 10, 2014 15:46

Hm, could you post the verbose compiler output for such a project, please? (add command line option "-v")


heare is the resut with the -v option

FreeBASIC Compiler - Version 0.91.0 (05-26-2014), built for win32 (32bit)
Copyright (C) 2004-2014 The FreeBASIC development team.
standalone
target: win32, 486, 32bit
compiling: VFE.BAS -o VFE.asm (main module)
C:\Documents and Settings\Roger\Bureau\VDesign_04_2014\GFB 5.0\gfb_controls.bi(605) warning 5(0): Implicit conversion
assembling: C:\fbc_win32_mingw\bin\win32\as.exe --32 --strip-local-absolute "VFE.asm" -o "VFE.o"
compiling rc: C:\fbc_win32_mingw\bin\win32\GoRC.exe /ni /nw /o /fo "DLGDMS.obj" "DLGDMS.RC"
linking: C:\fbc_win32_mingw\bin\win32\ld.exe -m i386pe -o "GFB 3.0.exe" -subsystem Gui "C:\fbc_win32_mingw\lib\win32\fbextra.x" --stack 1048576,1048576 -s -L "C:\fbc_win32_mingw\lib\win32" -L "." "C:\fbc_win32_mingw\lib\win32\crt2.o" "C:\fbc_win32_mingw\lib\win32\crtbegin.o" "C:\fbc_win32_mingw\lib\win32\fbrt0.o" "VFE.o" "DLGDMS.obj" "-(" -lkernel32 -lmsimg32 -lgdi32 -luser32 -lversion -ladvapi32 -lcomctl32 -lcomdlg32 -lmsvcrt -lfb -lgcc -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)" "C:\fbc_win32_mingw\lib\win32\crtend.o"
linking failed: 'C:\fbc_win32_mingw\bin\win32\ld.exe' terminated with exit code 1
St_W
Posts: 1504
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby St_W » Jun 10, 2014 16:33

Thank You.

The problem seems to be related to fbc. It only accepts lowercase input for subsystem. So "-s gui" does work, while "-s Gui" does not. The latter generates exactly the same error message, as "-subsystem Gui" is passed to the linker, instead of "-subsystem windows".

However, I tested the "-s Gui" parameter in a older versions of fbc (0.90.1, 0.24, 0.23) and the behaviour was the same.

So, do you have an "-s Gui" parameter in your fbc call? (note the uppercase "G")

If that's the case:
Which compiler version did you use to successfully compile it? Must be some quite old version (0.23 didn't allow it and is already some years old).
The solution to compile it using newer fbc versions is easy: just change it to a lowercase "g" in "-s gui".
aloberoger
Posts: 495
Joined: Jan 13, 2009 19:23

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby aloberoger » Jun 10, 2014 18:24

I do not think that the problem is on the capital letters or not. because the arguments passed are in small letters.
However it should be announced that this problem relates to certain projects but others are well compiled.
the project is compiled correctly with Version 0.91.0 (05-26-2014), but by adding the dynamic tables in a class
is needed a higher version.
the current verion fbc_win32_mingw uses ld.exe(2688ko)
St_W
Posts: 1504
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby St_W » Jun 11, 2014 11:35

aloberoger wrote:I do not think that the problem is on the capital letters or not. because the arguments passed are in small letters.
Ok - probably would have been too easy :-)

So you say it compiles fine using build #95 (2014-05-26) ?
That sounds quite strange to me as there have been only some minor changes to the compiler since then. You can look up the changes in the MinGW build changelog

Maybe you could provide a minimal code example / project setup that triggers the error?
Which build environment do you use? Some IDE like FBide/FBedit/wxFBE ? Or are you compiling your project just via commandline / batch script?
aloberoger
Posts: 495
Joined: Jan 13, 2009 19:23

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby aloberoger » Jun 11, 2014 19:26

with command line or with FBEDIT the result is the same one.
I returned to version 0.91.0 fbc.exe(1086ko) with ld.exe(1045ko) and the things go normally
therefore there is something wrong I think the code is not to blame .
I don't remember the date or the link of the fbc.exe above but here is the name of the download fbc0.91_x86_windows
perhaps the version of MOD?
fxm
Posts: 9946
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Postby fxm » Jun 11, 2014 19:40

aloberoger wrote:I don't remember the date or the link of the fbc.exe above but here is the name of the download fbc0.91_x86_windows
perhaps the version of MOD?

Yes but MOD has built 3 successive versions.
The last is always available at http://users.freebasic-portal.de/mod/da ... indows.zip.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests