Page 1 of 1
Erros on macOS
Posted: Sat Nov 27, 2021 6:08 pm
by Wolfram
I tried to compile one of my projects and I get an error message
Does anyone have an idea for a starting point ?
I get no information about line numbers and documents.
error: use of undeclared identifier 'mov'
mov [p.v_reg_b], rbx ; backup rbx
^
purebasic.c:4106:6: error: use of undeclared identifier 'p'
mov [p.v_reg_b], rbx ; backup rbx
^
purebasic.c:4106:18: error: use of undeclared identifier 'rbx'
...
2 warnings and 18 errors generated.
Re: Erros on macOS
Posted: Sat Nov 27, 2021 7:03 pm
by juergenkulow
Code: Select all
Procedure Test()
Protected reg_b.q
! mov [p.v_reg_b], rbx ;// backup rbx
EndProcedure
Test()
; PureBasic 6.00 Beta 1 - C Backend (Linux - x64)
; Error: Assembler
; error: ‘mov’ undeclared (first use in this function)
; mov [p.v_reg_b], rbx ;// backup rbx
; ^~~
; purebasic.c:65:3: note: each undeclared identifier is reported only once For each function it appears in
; purebasic.c:65:11: error: ‘p’ undeclared (first use in this function)
; mov [p.v_reg_b], rbx ;// backup rbx
; ^
; purebasic.c:65:23: error: ‘rbx’ undeclared (first use in this function)
; mov [p.v_reg_b], rbx ;// backup rbx
; ^~~
; purebasic.c: In function ‘SYS_Quit’:
; purebasic.c:121:1: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]
; exit(PB_ExitCode);
; ^~~~
; purebasic.c:121:1: warning: incompatible implicit declaration of built-in function ‘exit’
; purebasic.c:121:1: note: include ‘<stdlib.h>’ Or provide a declaration of ‘exit’
Re: Erros on macOS
Posted: Sat Nov 27, 2021 7:04 pm
by StarBootics
Does your code contain Assembler instructions some where ? Because if you try to use the C backend with Assembler code you will end up with errors like that. If so you need to wrap it like that :
Code: Select all
Protected Cos.f, Sin.f
CompilerIf Defined(PB_Compiler_Backend, #PB_Constant)
CompilerIf #PB_Compiler_Backend = #PB_Backend_Asm
!FLD dword [p.v_Theta]
!FSINCOS
!FSTP dword [p.v_Cos]
!FSTP dword [p.v_Sin]
CompilerElseIf #PB_Compiler_Backend = #PB_Backend_C
Cos.f = Cos(Theta)
Sin.f = Sin(Theta)
CompilerEndIf
CompilerElse
!FLD dword [p.v_Theta]
!FSINCOS
!FSTP dword [p.v_Cos]
!FSTP dword [p.v_Sin]
CompilerEndIf
Best regards
StarBootics
Re: Erros on macOS
Posted: Sat Nov 27, 2021 7:16 pm
by Wolfram
Yes, I forgot it, I have one function which is written in assembler.
Thanks.
Re: Erros on macOS
Posted: Sat Dec 04, 2021 11:34 pm
by WilliamL
This works for me. So no assembler allowed in C right now...
Code: Select all
Procedure TryIt()
Protected Cos.f, Sin.f , Theta
CompilerIf Defined(PB_Compiler_Backend, #PB_Constant)
CompilerIf #PB_Compiler_Backend = #PB_Backend_Asm
Debug "Assembler"
!FLD dword [p.v_Theta]
!FSINCOS
!FSTP dword [p.v_Cos]
!FSTP dword [p.v_Sin]
CompilerElseIf #PB_Compiler_Backend = #PB_Backend_C ;words ok when in C
Debug "C backend"
Cos.f = Cos(Theta)
Sin.f = Sin(Theta)
CompilerEndIf
CompilerElse
Debug"Something else?"
!FLD dword [p.v_Theta]
!FSINCOS
!FSTP dword [p.v_Cos]
!FSTP dword [p.v_Sin]
CompilerEndIf
EndProcedure
TryIt()