Where can I get a Recent-Git-Build of FreeBASIC?
Re: Where can I get a Recent-Git-Build of FreeBASIC?
Thank You,
this works fine!
Public Function TEST_DLL StdCall (ByVal dllName As ZString Ptr) As Any Ptr Export
Return DylibLoad(*dllName)
End Function
this works fine!
Public Function TEST_DLL StdCall (ByVal dllName As ZString Ptr) As Any Ptr Export
Return DylibLoad(*dllName)
End Function
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
Re: Where can I get a Recent-Git-Build of FreeBASIC?
Byref As Zstring should also work, if you don't want to have to change the function to use pointers internally.
Re: Where can I get a Recent-Git-Build of FreeBASIC?
In some circumstances, Byval as string seems to be slower than byref as string then using a copy to preserve the string.
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
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
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
Re: Where can I get a Recent-Git-Build of FreeBASIC?
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
Re: Where can I get a Recent-Git-Build of FreeBASIC?
Why not add just the folder inc\crt at http://users.freebasic-portal.de/stw/builds/?St_W wrote:The mingw package should contain everything that is needed to compile a freebasic program except Microsoft C Runtime.
Re: Where can I get a Recent-Git-Build of FreeBASIC?
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.
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.
-
- Posts: 507
- Joined: Jan 13, 2009 19:23
Re: Where can I get a Recent-Git-Build of FreeBASIC?
strange error while compiling some projects:
C:\fbc_win32_mingw\bin\win32\ld.exe: invalid subsystem type Gui
C:\fbc_win32_mingw\bin\win32\ld.exe: invalid subsystem type Gui
Re: Where can I get a Recent-Git-Build of FreeBASIC?
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)
Does it work with the "ld.exe" included in FreeBasic Release Packages? (-> Download)
-
- Posts: 507
- Joined: Jan 13, 2009 19:23
Re: Where can I get a Recent-Git-Build of FreeBASIC?
heare is the resut with the -v optionHm, could you post the verbose compiler output for such a project, please? (add command line option "-v")
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
Re: Where can I get a Recent-Git-Build of FreeBASIC?
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".
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".
-
- Posts: 507
- Joined: Jan 13, 2009 19:23
Re: Where can I get a Recent-Git-Build of FreeBASIC?
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)
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)
Re: Where can I get a Recent-Git-Build of FreeBASIC?
Ok - probably would have been too easy :-)aloberoger wrote:I do not think that the problem is on the capital letters or not. because the arguments passed are in small letters.
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?
-
- Posts: 507
- Joined: Jan 13, 2009 19:23
Re: Where can I get a Recent-Git-Build of FreeBASIC?
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?
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?
Re: Where can I get a Recent-Git-Build of FreeBASIC?
Yes but MOD has built 3 successive versions.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?
The last is always available at http://users.freebasic-portal.de/mod/da ... indows.zip.
Re: Where can I get a Recent-Git-Build of FreeBASIC?
Note: I'm not updating the link anymore unless it's necessary. My builds were made by hand and since St_W got his automatic builds running, there's no need for my builds anymore. Nevertheless, I won't delete the last version so the link will stay available until the end of the world. ;)