Can't run on Pi any longer

Post your Gambas programming questions here.
User avatar
sadams54
Posts: 139
Joined: Monday 9th July 2018 3:43am
Contact:

Can't run on Pi any longer

Post by sadams54 »

I have been running some of my work on the raspberry pi. Works nice until now.
when I attempt to run a new verson of the programs I wrote I get this...

ERROR: #2: Cannot load class 'FMain': Bytecode too recent. Please upgrade Gambas.

Gambas is up to date on the pi. Version 3.12.2 When I to the apt-get upgrade Gambas3 it tells me everything is up to date. However attempting to run the program gives the error still. Any Help?
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Can't run on Pi any longer

Post by stevedee »

This sounds familiar. Its probably due to Gambas version differences.

Try opening the project in Gambas on the Pi, then menu Project > Compile All. It should now run.
User avatar
sadams54
Posts: 139
Joined: Monday 9th July 2018 3:43am
Contact:

Re: Can't run on Pi any longer

Post by sadams54 »

nope. Tried that before posting and even attempting to run the project in a full gambas on the pi gives that same error in gambas editor. I tried making new executable on the pi and when I go to run it, same error.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Can't run on Pi any longer

Post by BruceSteers »

That happens if an app has been compiled on a higher version gambas.
Is that the case? (initially)

There's an undocumented (and little known about) Environment variable to fix this.

In the project settings on the newer gambas IDE go to "Environment" and add a variable
GB_PCODE_VERSION and set it to 3.8

That will fix the bytecode error when running an app on a lesser gambas runtime and may fix your error too.

If you have compiled the app on the same gambas that it errors on then there must be a conflict somewhere,
ie an older version runtime on the system.
I'd recommend a re-install

or if you have downloaded and compiled gambas then your previous repository install and compilation install will conflict.


Hope this helps
If at first you don't succeed , try doing something differently.
BruceS
User avatar
sadams54
Posts: 139
Joined: Monday 9th July 2018 3:43am
Contact:

Re: Can't run on Pi any longer

Post by sadams54 »

Thanks for the advice. I put in the variable and made a new executable but same exact error. The problem does not exist on my fedora systems so must be problem on the pi version
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Can't run on Pi any longer

Post by BruceSteers »

Sorry I can't see if i get the same error as i have Gambas 3.15 on my PI
maybe upgrade the gambas to 3.15?
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Can't run on Pi any longer

Post by BruceSteers »

Darn it lol ,
There has to be a way...

Maybe deleting the contents of the .gambas directory in the projects folder could force a rebuild of the app?
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Can't run on Pi any longer

Post by BruceSteers »

Sounds like it's not compiling/saving the exe properly.
The PCODE variable should make an app work on anything down do gambas 3.8

are write access permissions okay on the folder/files?

pcode variable set like this...
PCODE.png
That should work unless the executable has not compiled correctly.
Maybe try compiling the app on another machine, even if has gambas 3.15 using the PCODE variable should make it compatible.
Unless the app has specific modern code that doesn't exist for a lesser gambas.
I have a few apps and none of them compiled on 3.15 fail to work on 3.12 with the GB_PCODE_VERSION=3.8 set in its settings.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Can't run on Pi any longer

Post by BruceSteers »

One other thing to check to see if it's a problem with the specific app or a problem in gambas itself is to quickly make a hello world type new project on gambas on the pi and compile it and see if that runs okay.
If yes then it must be the app itself.

If so i'd recommend the best thing to do is open the .gambas folder in the projects directory and delete the FMain (and any other) file in there. then the compiler will re-make it for your gambas.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
sadams54
Posts: 139
Joined: Monday 9th July 2018 3:43am
Contact:

Re: Can't run on Pi any longer

Post by sadams54 »

I originally set up using gambas 3.15 on other system. Never had a problem like this before. it just always worked. I tried to remove gambas on the pi and it didn't seem to actually remove it. But when I go to install gambas I only see 3.12 available. I am sure this needs to be updated which is what the message says but there is no upgrade...

As far as removing fmain that is the program. deleting that would be deleting the program? am I thinking right?

I can write a program on the pi (which is not what I usually do because the program goes many places) and that is ok, but instead of focusing on the program would it not be best to focus on updating gambas runtime? That seems to be the issue and all apt-get says that gambas 3.12 is the most up to date.
Post Reply