Dark Bit Factory & Gravity

PROGRAMMING => Freebasic => Topic started by: Paul on March 23, 2007

Title: Constructor?
Post by: Paul on March 23, 2007
How do i declare a constructor?
this is my try and it doesn't work :(

Code: [Select]

type thing
    Declare Constructor()
   
end type

constructor thing
   
end constructor

Title: Re: Constructor?
Post by: Shockwave on March 23, 2007
Aha, you should read this great tutorial by our very own RDC http://dbfinteractive.com/index.php?cat=157 (http://dbfinteractive.com/index.php?cat=157) Hope that helps, any questions please post :D
Title: Re: Constructor?
Post by: Paul on March 23, 2007
Just needed the cvs version :)

Edit: does this work with Tiny PTC ?? and if so, do i need to reinstall it?
Title: Re: Constructor?
Post by: rdc on March 23, 2007
tinyptc doesn't work with the CVS version. You'll need to get RBraz's tinyptc_ext. That works just fine with the CVS version.
Title: Re: Constructor?
Post by: Paul on March 23, 2007
I tried and got a long list of errors, is there anything special to think about?

Here is the error list if anyone is interested.

Edit: the error log diddn't update: new log-->

Code: [Select]
Command executed:
"C:\Program Files\FreeBasic\fbc.exe" "C:\Documents and Settings\david1.DAVID\Desktop\paul\freebasic\fire\FBIDETEMP.bas"

Command executed:
"C:\Program Files\FreeBasic\fbc.exe" "C:\Documents and Settings\david1.DAVID\Desktop\paul\freebasic\fire\firebeta.bas"

Compiler output:
C:\Documents and Settings\david1.DAVID\Desktop\paul\freebasic\fire\firebeta.o:fake:(.text+0x72): undefined reference to `ptc_open'
C:\Documents and Settings\david1.DAVID\Desktop\paul\freebasic\fire\firebeta.o:fake:(.text+0x8f): undefined reference to `ptc_update'
C:\Documents and Settings\david1.DAVID\Desktop\paul\freebasic\fire\firebeta.o:fake:(.text+0xa5): undefined reference to `ptc_close'

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 0.17 (03-23-2007) for win32 (target:win32)
OS:    Windows 2000 (build 2195, Service Pack 4)



Title: Re: Constructor?
Post by: rdc on March 24, 2007
These are linker errors; the linker couldn't find the library. Make sure you put the .bi file in the inc folder, and the .a in the lib\win32 folder (if you are on windows).
Title: Re: Constructor?
Post by: Paul on March 24, 2007
Tried reinstalling tinyPTC and tinyptc_ext, that didn't work. but when i reinstalled freebasic, updated and then installed tinyptc_ext then i got i t to work

Thx for all the hwlp shocky and rdc :)

really appreciated :D
Title: Re: Constructor?
Post by: rdc on March 24, 2007
It might have been that you didn't have all the libs you needed in your first install. Glad you got it working.
Title: Re: Constructor?
Post by: Shockwave on March 24, 2007
Ditto what rdc said :) Nice to know you're up and running mate.