Does anyone know why the following error occurs?
PureBasic - Linker Error
Undefined symbols:
"_CGRectMake" referenced from:
PSTub.CGRectMake in purebasic.o
Id: symbol(s) not found
collect2: Id returned 1 exit status.
FYI, [CGRectMake] is a Carbon function called with [ImportC].
Linker Error - What does it mean?
Re: Linker Error - What does it mean?
In the example code of your posting Help with CGContext you forgot to declarecoder14 wrote:Does anyone know why the following error occurs?
the return type CGRect for the API function CGRectMake().
Unfortunately even if you declare the return type correctly PureBasic will displayPureBasic Help for Import wrote:Import "Filename"
FunctionName.<type>(<parameter>, [, <parameter> [= DefaultValue]...]) [As "SymbolName"]
...
VariableName.<type> [As "SymbolName"]
EndImport
the following error:
because PureBasic can't return a structure from a function, so unfortunately itPureBasic wrote:A structure can't be used with ProcedureReturn
is not possible to use this function...
This is a complete example which causes the above error message:
Code: Select all
Structure CGPoint
X.F
Y.F
EndStructure
Structure CGSize
Width.F
Height.F
EndStructure
Structure CGRect
Origin.CGPoint
Size.CGSize
EndStructure
ImportC ""
CGRectMake.CGRect(X.F, Y.F, Width.F, Height.F)
EndImport
*Rect.CGRect = CGRectMake(0.0, 0.0, 600.0, 600.0)
Debug "*Rect\Origin\X = " + Str(*Rect\Origin\X)
