[Done] App won't compile

All bugs related to new C backend
BarryG
Addict
Addict
Posts: 1556
Joined: Thu Apr 18, 2019 8:17 am

[Done] App won't compile

Post by BarryG »

I get this error when using the C compiler. I have no idea what it means so I can't help further without some advice. Or, maybe the error is obvious to Fred and it can be fixed easily?

Image

[Edit] Okay, so the "__parseexpression" is from Danilo's "Evaluate.pbi" file here -> http://forums.purebasic.com/german/view ... =8&t=24256

The "MouseIsOver" code is this procedure:

Code: Select all

Global mouseisoverx,mouseisovery
Procedure MouseIsOver(hWnd)
  GetWindowRect_(hWnd,r.RECT)
  GetCursorPos_(p.POINT)
  mouseisoverx=p\x
  mouseisovery=p\y
  ok=PtInRect_(r,p\y<<32+p\x)
  ProcedureReturn ok
EndProcedure

I also noticed today the following error about "mov" being an unknown type:

Image

This uses Wilbert's Date64 module here -> viewtopic.php?p=478507#p478507

Hope this helps, but I'll be honest: these scare me off using v6.00 now. How many more little errors like this are going to pop up? It seems like code we've used for years is now unusable until a fix is made, but how do we know that Fred can fix them all? And are they just little Band-Aid fixes, or general syntax fixes? Because if they're Band-Aids, then that's not a reliable solution and v5.73 will have to be my last PureBasic (because I don't want to have to keep posting little error reports like this whenever I add features and new functions to my code).
Last edited by BarryG on Mon Jun 21, 2021 7:52 am, edited 12 times in total.
User avatar
Keya
Addict
Addict
Posts: 1864
Joined: Thu Jun 04, 2015 7:10 am

Re: App won't compile

Post by Keya »

please provide the code that triggers the error so Fred at least has something to work with
BarryG
Addict
Addict
Posts: 1556
Joined: Thu Apr 18, 2019 8:17 am

Re: App won't compile

Post by BarryG »

Edited first post with some info.
Last edited by BarryG on Mon Jun 21, 2021 5:14 am, edited 1 time in total.
Cyllceaux
Enthusiast
Enthusiast
Posts: 332
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: App won't compile

Post by Cyllceaux »

BarryG wrote: Mon Jun 21, 2021 3:29 am Would love to post something to help, but with over 45000 lines it's hard to know which code is triggering it. As I said, I'm hoping the error message contains something obvious that can be fixed without the need for code.
Hey there... the error occurs in a procedure called MouseIsOver and __parseexpression Can you post this procedures?
BarryG
Addict
Addict
Posts: 1556
Joined: Thu Apr 18, 2019 8:17 am

Re: App won't compile

Post by BarryG »

Thanks for the info, Cyllceaux! Didn't notice those were parts of my procedures at first. First posted edited.
User avatar
STARGÅTE
Addict
Addict
Posts: 1556
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: App won't compile

Post by STARGÅTE »

BarryG wrote: Mon Jun 21, 2021 2:38 amHope this helps, but I'll be honest: these scare me off using v6.00 now. How many more little errors like this are going to pop up? It seems like code we've used for years is now unusable until a fix is made, but how do we know that Fred can fix them all? And are they just little Band-Aid fixes, or general syntax fixes? Because if they're Band-Aids, then that's not a reliable solution and v5.73 will have to be my last PureBasic (because I don't want to have to keep posting little error reports like this whenever I add features and new functions to my code).
Please note, the version 6.00 is in alpha.
There are a lot of errors in this version especially such compile errors. But it is very important, that we (the community) test this version to find more and more bugs which can be fixed.
Please also note, that the PB 6.00 with the C-backend is a version which was written from scratch.
You can't ask for this version to be "as stable as" the old version 5.73.

Edit: Regarding the second error "about "mov" being an unknown type" means, this include use ASM Code, which is not allowed in the C-backend.
PB 5.73 ― Win 10, 20H2 ― Ryzen 9 3900X ― Radeon RX 5600 XT ITX ― Vivaldi 3.6 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
BarryG
Addict
Addict
Posts: 1556
Joined: Thu Apr 18, 2019 8:17 am

Re: App won't compile

Post by BarryG »

STARGÅTE wrote: Mon Jun 21, 2021 9:10 amthe PB 6.00 with the C-backend is a version which was written from scratch.
You can't ask for this version to be "as stable as" the old version 5.73.
From scratch? I didn't know this. I thought it was just going to be a small conversion by the compiler with some testing that might go for a month or two. If it's a whole re-write, then this testing will take literally years to get to v5.73 equivalency, and I don't have time for that. I'll have to stick with v5.73 after all.
User avatar
STARGÅTE
Addict
Addict
Posts: 1556
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: App won't compile

Post by STARGÅTE »

BarryG wrote: Mon Jun 21, 2021 11:06 am
STARGÅTE wrote: Mon Jun 21, 2021 9:10 amthe PB 6.00 with the C-backend is a version which was written from scratch.
You can't ask for this version to be "as stable as" the old version 5.73.
From scratch? I didn't know this. I thought it was just going to be a small conversion by the compiler with some testing that might go for a month or two. If it's a whole re-write, then this testing will take literally years to get to v5.73 equivalency, and I don't have time for that. I'll have to stick with v5.73 after all.
You can follow Fred's blog:
https://www.purebasic.fr/blog/?p=480 wrote:For the past 8 months, we decided to focus on a new high-level back-end for PureBasic: the C language.
PB 5.73 ― Win 10, 20H2 ― Ryzen 9 3900X ― Radeon RX 5600 XT ITX ― Vivaldi 3.6 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
infratec
Always Here
Always Here
Posts: 5418
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: App won't compile

Post by infratec »

simply don't select the pbcompilerc :wink:

Then it is not a complete new development.
Axolotl
Enthusiast
Enthusiast
Posts: 116
Joined: Wed Dec 31, 2008 3:36 pm

Re: App won't compile

Post by Axolotl »

I checked MouseIsOver(hWnd) with PB 6.00 Alpha2 and this tiny sample code. -> no problems
EDIT: Shame on me... (used wrong compiler settings) sorry!
EDIT-2: I see different behaviors with different backends: FASM works fine, C always returns 0

Code: Select all

Global mouseisoverx, mouseisovery 
 
Procedure MouseIsOver(hWnd) 
  GetWindowRect_(hWnd, r.RECT) 
  GetCursorPos_(p.POINT) 
  mouseisoverx=p\x
  mouseisovery=p\y
  ok = PtInRect_(r, p\y<<32+p\x)   
  ProcedureReturn ok                           ;' <--- always 0 with c backend (???) 
EndProcedure

;' Sample Program from Help with small modifications  
hWnd = OpenWindow(0, 0, 0, 300, 50, "Position of the mouse on the desktop", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If hWnd 
  TextGadget(0, 10,  6, 200, 20, "")
  TextGadget(1, 10, 26, 200, 20, "")
  AddWindowTimer(0, 0, 10) ; Timeout = 10 ms
  
  Repeat
    Event = WaitWindowEvent()
    If Event = #PB_Event_Timer 
      SetGadgetText(0, "Coordinates: " + Str(DesktopMouseX()) + "," + Str(DesktopMouseY()))  
      ok = MouseIsOver(hWnd) 
      SetGadgetText(1, "Mouse over me == " + Str(ok)) 
    EndIf
  Until Event = #PB_Event_CloseWindow
EndIf
Last edited by Axolotl on Mon Jun 21, 2021 4:23 pm, edited 2 times in total.
Mostly running PureBasic <latest stable version and current alpha/beta> (x64) on Windows 10 Home
Fred
Administrator
Administrator
Posts: 14348
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: App won't compile

Post by Fred »

BarryG wrote: Mon Jun 21, 2021 2:38 amHope this helps, but I'll be honest: these scare me off using v6.00 now. How many more little errors like this are going to pop up? It seems like code we've used for years is now unusable until a fix is made, but how do we know that Fred can fix them all? And are they just little Band-Aid fixes, or general syntax fixes? Because if they're Band-Aids, then that's not a reliable solution and v5.73 will have to be my last PureBasic (because I don't want to have to keep posting little error reports like this whenever I add features and new functions to my code).

Don't panic, it always been like that. That's why it's an Alpha version, meaning mostly dead broken. It's not band-aid fixes, you can't do that on a compiler as it needs to be versatile enough to handle any form of expressions. Every new errors are converted into a unit tests, which means it won't happen again, as the unit tests needs to be 100% working before releasing the compiler. I can understand you don't want to spend time on it. Just don't, there is enough people reporting here to keep me busy ;).

BTW: the ASM version won't stop at 5.73, I don't know where you got this idea. The 2 back-ends will continue to evolve together, so just select the one you prefer.
BarryG
Addict
Addict
Posts: 1556
Joined: Thu Apr 18, 2019 8:17 am

Re: App won't compile

Post by BarryG »

Thanks for the info, Fred, and for reassuring that the ASM version will continue.
infratec wrote: Mon Jun 21, 2021 2:30 pmsimply don't select the pbcompilerc :wink:
The reason I was testing the C version is that it apparently brings faster speed to my apps, according to reports I've read in this forum. Plus reduced anti-virus false-positives. That's why I was interested in switching to it. But I'll stay with v5.73 for now.
Fred
Administrator
Administrator
Posts: 14348
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: App won't compile

Post by Fred »

Fixed.
Post Reply