July 21, 2019, 10:50:17 AM

Author Topic: BlitzMax NG compile error on Linux (Zorin OS)  (Read 131 times)

Offline sphinx

  • Full Member
  • ***
  • Posts: 206
    • Ancientsoft
BlitzMax NG compile error on Linux (Zorin OS)
« on: July 06, 2019, 07:30:24 AM »
My game compile and starts without any problem but keyboard and mouse are not working at all!
I tried a very simple test thinking maybe my game has a specific problem:
Code: [Select]
Graphics 800,600,0

While Not KeyHit(key_escape)
Cls
DrawText Rand(100),100,100
Flip
Wend

but it does not work too!

I tried to rebuild the modules and I got the error attached
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Offline Derron

  • Hero Member
  • *****
  • Posts: 2218
Re: BlitzMax NG compile error on Linux (Zorin OS)
« Reply #1 on: July 06, 2019, 07:43:40 AM »
Did you try on a major linux distribution? (Ubuntu, Mint, Manjaro, ... )?

Just had a look and it seems they sell an "ultimate version" which sounds like "our other releases are crippled somewhere".

----

What NG version have you installed?
What gcc is installed ($ gcc -v) ?
What "Zorin OS" have you installed?
Are you using a "copied from some computer" NG version which might have these precompilates already? -> do not "quick" compile if having done so.


bye
Ron

Offline sphinx

  • Full Member
  • ***
  • Posts: 206
    • Ancientsoft
Re: BlitzMax NG compile error on Linux (Zorin OS)
« Reply #2 on: July 06, 2019, 07:50:44 AM »
Did you try on a major linux distribution? (Ubuntu, Mint, Manjaro, ... )?

Just had a look and it seems they sell an "ultimate version" which sounds like "our other releases are crippled somewhere".

----

bye
Ron

Same on Ubuntu!
Even on OSX when I try using :
Code: [Select]
Import SDL.GLSDLMax2D
On Linux and without SDL module I have no control over mouse and keyboard!

Quote
What NG version have you installed?
I have the latest version of NG from Github BlitzMax Linux.x64 v0.105.3.35

Quote
What gcc is installed ($ gcc -v) ?
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)

Quote
What "Zorin OS" have you installed?
Core essential

Quote
Are you using a "copied from some computer" NG version which might have these precompilates already? -> do not "quick" compile if having done so.
I will check!
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Offline Derron

  • Hero Member
  • *****
  • Posts: 2218
Re: BlitzMax NG compile error on Linux (Zorin OS)
« Reply #3 on: July 06, 2019, 07:54:16 AM »
With vanilla/legacy BlitzMax you get keystrokes recognized?

When utilizing SDL you get keystrokes?


bye
Ron

Offline Derron

  • Hero Member
  • *****
  • Posts: 2218
Re: BlitzMax NG compile error on Linux (Zorin OS)
« Reply #4 on: July 06, 2019, 08:05:41 AM »
Code: BlitzMax
  1. SuperStrict
  2. Framework Brl.StandardIO
  3. Import Brl.GLMax2D
  4.  
  5. Graphics 800,600,0
  6.  
  7. 'maybe enable this?
  8. 'EnablePolledInput()
  9.  
  10. Local lastDown:Int = -1
  11. Local lastHit:Int = -1
  12. Local lastHits:String[20]
  13. Local lastDowns:String[20]
  14. While Not KeyHit(KEY_ESCAPE)
  15.         Cls
  16.  
  17.         'print out all hit keys
  18.         Local hitKeyNum:Int = 0
  19.         For Local i:Int = 0 Until 255
  20.                 Local kh:Int = KeyHit(i) 'state is reset after this command!
  21.                 Local kd:Int = KeyDown(i) 'state is reset after this command!
  22.        
  23.                 If kh Then lastHit = i
  24.                 If kd Then lastDown = i
  25.                
  26.                 If kh Then lastHits = lastHits[1..] + ["Hit: " + i + " at " + MilliSecs()]
  27.                 If kd Then lastDowns = lastDowns[1..] + ["Downs: " + i + " at " + MilliSecs()]
  28.  
  29.                 If kh Or kd
  30.                         DrawText("key " + i + "  hit=" + kh + "  down=" + kd, 100, 20 + hitKeyNum*10)
  31.                         hitKeyNum :+ 1
  32.                 EndIf
  33.         Next
  34.        
  35.         For Local i:Int = 0 Until lastHits.length
  36.                 DrawText(lastHits[i], 350, 20 + i * 10)
  37.         Next
  38.  
  39.         For Local i:Int = 0 Until lastDowns.length
  40.                 DrawText(lastDowns[i], 550, 20 + i * 10)
  41.         Next
  42.        
  43.         Flip
  44. Wend
  45.  

try this (and maybe EnablePolledInput() - albeit graphics creation should do this)

Offline sphinx

  • Full Member
  • ***
  • Posts: 206
    • Ancientsoft
Re: BlitzMax NG compile error on Linux (Zorin OS)
« Reply #5 on: July 06, 2019, 08:08:06 AM »
Code: BlitzMax
  1. SuperStrict
  2. Framework Brl.StandardIO
  3. Import Brl.GLMax2D
  4.  
  5. Graphics 800,600,0
  6.  
  7. 'maybe enable this?
  8. 'EnablePolledInput()
  9.  
  10. Local lastDown:Int = -1
  11. Local lastHit:Int = -1
  12. Local lastHits:String[20]
  13. Local lastDowns:String[20]
  14. While Not KeyHit(KEY_ESCAPE)
  15.         Cls
  16.  
  17.         'print out all hit keys
  18.         Local hitKeyNum:Int = 0
  19.         For Local i:Int = 0 Until 255
  20.                 Local kh:Int = KeyHit(i) 'state is reset after this command!
  21.                 Local kd:Int = KeyDown(i) 'state is reset after this command!
  22.        
  23.                 If kh Then lastHit = i
  24.                 If kd Then lastDown = i
  25.                
  26.                 If kh Then lastHits = lastHits[1..] + ["Hit: " + i + " at " + MilliSecs()]
  27.                 If kd Then lastDowns = lastDowns[1..] + ["Downs: " + i + " at " + MilliSecs()]
  28.  
  29.                 If kh Or kd
  30.                         DrawText("key " + i + "  hit=" + kh + "  down=" + kd, 100, 20 + hitKeyNum*10)
  31.                         hitKeyNum :+ 1
  32.                 EndIf
  33.         Next
  34.        
  35.         For Local i:Int = 0 Until lastHits.length
  36.                 DrawText(lastHits[i], 350, 20 + i * 10)
  37.         Next
  38.  
  39.         For Local i:Int = 0 Until lastDowns.length
  40.                 DrawText(lastDowns[i], 550, 20 + i * 10)
  41.         Next
  42.        
  43.         Flip
  44. Wend
  45.  

try this (and maybe EnablePolledInput() - albeit graphics creation should do this)

Same problem!!
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Offline sphinx

  • Full Member
  • ***
  • Posts: 206
    • Ancientsoft
Re: BlitzMax NG compile error on Linux (Zorin OS)
« Reply #6 on: July 06, 2019, 08:09:26 AM »
With vanilla/legacy BlitzMax you get keystrokes recognized?

When utilizing SDL you get keystrokes?


bye
Ron

I think I have a problem and something is missing because with legacy BlitzMax I can not even compile any code!!!
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Offline Derron

  • Hero Member
  • *****
  • Posts: 2218
Re: BlitzMax NG compile error on Linux (Zorin OS)
« Reply #7 on: July 06, 2019, 09:44:51 AM »
Sometimes you should consider to add the exact errors ("cannot compile" is not an error message).


My code should work if your x-system is properly configured and emitting events.


run this in a terminal:
Code: [Select]
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
and when the window opened, press some keys.
In the terminal you should see the keys hit.


If so we could create some advanced codes to see if events are properly triggered or not.
Please also post which version of NG you are using. And please first start with an Ubuntu/Mint distribution until we got this working - we can later on try to tackle that Zorin OS.

bye
Ron

Offline sphinx

  • Full Member
  • ***
  • Posts: 206
    • Ancientsoft
Re: BlitzMax NG compile error on Linux (Zorin OS)
« Reply #8 on: July 06, 2019, 03:39:52 PM »
Sometimes you should consider to add the exact errors ("cannot compile" is not an error message).


My code should work if your x-system is properly configured and emitting events.


run this in a terminal:
Code: [Select]
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
and when the window opened, press some keys.
In the terminal you should see the keys hit.


If so we could create some advanced codes to see if events are properly triggered or not.
Please also post which version of NG you are using. And please first start with an Ubuntu/Mint distribution until we got this working - we can later on try to tackle that Zorin OS.

bye
Ron

Thanks Ron.

I tried on Ubuntu and keys I hit are shown but they appear bit slow, I mean not in real time as I hit!

My NG version :
MaxIDE 1.52 [ng] (x64)
BCC Version : bcc [ng] Release version 0.105
bmk Version : bmk 3.35 mt-linux-x64 / gcc 070400
GCC : 7
G++ : 7
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com