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

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

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

Post by AGS »

MOD wrote:From today we have new builds from Git on FreeBASIC Portal.

For now, it's a transitional solution (in ger. "Übergangslösung",). They're not daily builds and DOS is missing, but I try to compile and upload new versions right after changes are submitted to the fbc repo.
Yes! Downloaded it already. Ganz toll, sehr güt, vielen Dank!
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

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

Post by AGS »

MOD wrote:I'm not sure that's happening there. You could try to use -R and check, if the main() is emitted. Or -v to check the main module.

Maybe it's a problem of your IDE. Try to compile by hand in console.
I compiled by hand in console: no problem here (windows 7 pro).
This is the output I am getting (aside: using -exx or -g does not alter the outcome, it's all good).

Code: Select all

LoopAis on iteration 1
LoopBis on iteration 1
LoopAis on iteration 2
LoopBis on iteration 2
LoopAis on iteration 3
LoopBis on iteration 3
LoopAis on iteration 4
LoopBis on iteration 4
LoopAis on iteration 5
LoopBis on iteration 5
LoopAis on iteration 6
LoopBis on iteration 6
LoopAis on iteration 7
LoopBis on iteration 7
LoopAis on iteration 8
LoopBis on iteration 8
LoopAis on iteration 9
LoopBis on iteration 9
LoopAis on iteration 10
LoopBis on iteration 10
All done (and without Dim Shared!)
But I don't get the without Dim Shared: I thought Dim Shared was needed to make sure your code is thread safe ;)
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Post by fxm »

MOD wrote:Try to compile by hand in console.
Yes, it works!

In fact, I found that the compiler error is linked with the length of the path:
"d:\Documents and Settings\t0003830\Mes documents\fbc0.24_windows20120104\fbc.exe" "d:\Documents and Settings\t0003830\Mes documents\FBIde0.4.6\FBIDETEMP.bas" -exx
does not work,
else:
"d:\Documents and Settings\t0003830\Mes documents\fbc0.24_windows20120104\fbc.exe" "d:\Documents and Settings\t0003830\Mes documents\FBIde\FBIDETEMP.bas" -exx
works!

I do not understand because all my other programs with the previous build (fbc 0.23.0) compiled fine with this first path!
and even with a path + 3 characters: 'FBIde0.4.6r3+'
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

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

Post by dkl »

It was a bug in 0.24 that I introduced when making some file name handling changes last year. The main module name was getting cut off internally, causing the input .bas to not be treated as the main module. That's fixed now.

So, thanks for testing 0.24 guys!
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Post by fxm »

Thank you dkl and AGS

Except this little problem above, everything seems to work perfectly!
I am testing only the Windows build.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Post by fxm »

AGS wrote:But I don't get the without Dim Shared: I thought Dim Shared was needed to make sure your code is thread safe ;)
I do not understand your remark above.
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

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

Post by TJF »

fxm wrote:
AGS wrote:But I don't get the without Dim Shared: I thought Dim Shared was needed to make sure your code is thread safe ;)
I do not understand your remark above.
Scroll down the code block :)
MOD
Posts: 555
Joined: Jun 11, 2009 20:15

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

Post by MOD »

I've just compiled and uploaded the new builds. Thx dkl :)
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Post by fxm »

dkl wrote:It was a bug in 0.24 that I introduced when making some file name handling changes last year. The main module name was getting cut off internally, causing the input .bas to not be treated as the main module. That's fixed now.
MOD wrote:I've just compiled and uploaded the new builds. Thx dkl :)
Ok now with this today build and my very long path of module name!
Thank you both.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Post by fxm »

I ran again a few tests in OOP with this new Git-Build and I found again, among the deflects, the two major identified as bugs that I previously reported in May 2011 in this other topic:
http://www.freebasic.net/forum/viewtopi ... 17&t=17571

- When we define an instance of a child type, the compiler does not test if the parent type(s) has(have) a default constructor:
http://www.freebasic.net/forum/viewtopi ... 41#p157841

- Private/Protected access control versus member procedure/data:
OK for member procedure,
NOK for member data (both access controls following the same rule corresponding to Protected access control specification):
http://www.freebasic.net/forum/viewtopi ... 52#p161652


It would be nice for the future version 0.24, that the main bugs at least were fixed + documentation updated with the 4 new keywords ('Extends', 'Object', 'Base', 'Is'), and eventually new other OOP features!
It seems that everything has stopped on this since May:
v1ctor can he return to this subject (or someone else)?



Annex:
Just a small example whose the sole interest is the use of the four new keywords for OOP ('Extends', 'Object', 'Base', 'Is'):

Code: Select all

Type animal Extends Object ' 'Extends' to activate Run-Time Type Info (RTTI) by inheritance of the predefined Object type
  Declare Function TypeInstance () As String
  Declare Function TypeHierarchy () As String
End Type ' type may be member data empty

Function animal.TypeHierarchy () As String
  Return "object(forRTTI) <- animal"
End Function

Type dog Extends animal ' 'Extends' to inherite of animal
  Declare Function TypeHierarchy () As String
End Type ' type may be member data empty

Function dog.TypeHierarchy () As String
  Return Base.TypeHierarchy & " <- dog" ' 'Base.' allows to access to parent member function
End Function

Type cat Extends animal ' 'Extends' to inherite of animal
  Declare Function TypeHierarchy () As String
End Type ' type may be member data empty

Function cat.TypeHierarchy () As String
  Return Base.TypeHierarchy & " <- cat" ' 'Base.' allows to access to parent member function
End Function

Function animal.TypeInstance () As String ' must be put after definition of dog type and cat type
  If This Is dog Then ' 'Is' allows to compare with type symbol
    Return "dog"
  Elseif This Is cat Then ' 'Is' allows to compare with type symbol
    Return "cat"
  Else
    Return "animal"
  End If
End Function



Print "Name:", "Instance of:", , "Hierarchy:"

Dim mouse As animal
Print " mouse",
Print " " & mouse.TypeInstance, ,
Print " " & mouse.TypeHierarchy

Dim Buddy As dog
Print " Buddy",
Print " " & Buddy.TypeInstance, ,
Print " " & Buddy.TypeHierarchy

Dim Tiger As cat
Print " Tiger",
Print " " & Tiger.TypeInstance, ,
Print " " & Tiger.TypeHierarchy

Sleep
Last edited by fxm on Jan 11, 2012 11:41, edited 1 time in total.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Post by fxm »

TJF wrote:
fxm wrote:
AGS wrote:But I don't get the without Dim Shared: I thought Dim Shared was needed to make sure your code is thread safe ;)
I do not understand your remark above.
Scroll down the code block :)
Now let's be serious!

I think that 'Dim Shared' is a method for beginners to pass variables to a thread.
With 'Threadcreate', it is best to use the 'Byval As Any Ptr' argument as a pointer to a data structure (UDT, array, ...).
See my previous other post (including 3 proposed syntaxes in examples):
http://www.freebasic.net/forum/viewtopi ... 51#p167651

In the example of the manual (KeyPgThreadCall), one of the data is a common mutex handle ('Any Ptr') in order to synchronize threads between themselves.
In the version using 'Threadcreate' + UDT structure, as presently no static member data can be defined, an emulation of a static member data may be used as following:

Code: Select all

' Threading using "ThreadCreate" + UDT untyped pointer

Type thread_data
  Dim id As String
  Dim count As Integer
  Declare Static Function tlock (Byval param As Any Ptr = 0) As Any Ptr
End Type

Static Function thread_data.tlock (Byval param As Any Ptr = 0) As Any Ptr
  Static p As Any Ptr
  p = Iif(param > 0, param, p)
  Function = p
End Function

Sub thread( Byval param As Any Ptr )
  With *Cast(thread_data Ptr, param)
    For i As Integer = 1 To .count
      MutexLock .tlock
      Print "thread "; .id, i; "/"; .count
      MutexUnlock .tlock
    Next
  End With
End Sub

thread_data.tlock(MutexCreate())
Dim pA As thread_data Ptr = New thread_data
pA->id = "A"
pA->count = 6
Dim a As Any Ptr = ThreadCreate(@thread, pA)
Dim pB As thread_data Ptr = New thread_data
pB->id = "B"
pB->count = 4
Dim b As Any Ptr = ThreadCreate(@thread, pB)
ThreadWait a
ThreadWait b
MutexDestroy thread_data.tlock
Delete pA
Delete pB
Print "All done (and also without Dim Shared!)"

Sleep
Last edited by fxm on Jan 13, 2012 12:03, edited 1 time in total.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

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

Post by VANYA »

Here are some examples:

Code: Select all

Type One extends OBJECT
	a As Integer = 1234
End Type
And what an Object? :

Code: Select all

Type OBJECT
	'What is here?
End Type
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Post by fxm »

'Object' is a predefined type which allows (by inheritance) to access to the Run-Time Type Info (RTTI), authorizing the use of the new keyword 'Is' to compare 'This' with type symbols.
See my short example above:
http://www.freebasic.net/forum/viewtopi ... 02#p169002
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

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

Post by VANYA »

Yes, a good example, but I did not at once realize it :) Thanks
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Post by fxm »

I have a problem testing the last Git-build of FreeBASIC (05.02.2012) at:
http://www.freebasic-portal.de/download ... uilds.html

Compiler output:
D:\Prg\FXM\fbc0.24_windows20120205\FBIDETEMP.bas() error 79: Executable not found: "D:\Prg\FXM\fbc0.24_windows20120205\..\bin\as.exe"

This path "D:\Prg\FXM\fbc0.24_windows20120205\..\bin\as.exe" is erroneous.
(instead of "D:\Prg\FXM\fbc0.24_windows20120205\bin\as.exe" or "D:\Prg\FXM\fbc0.24_windows20120205\bin\win32\as.exe" as for official version)

In addition, I think there is other defects!
(if I put the 'bin' directory in "D:\Prg\FXM\", I obtain: error 79: Executable not found: "D:\Prg\FXM\fbc0.24_windows20120205\..\bin\windres.exe"
Post Reply