Used #OPTIMIZE SIZE got #Resource Error

Started by Theo Gottwald, April 07, 2023, 04:57:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

Today i got a Resource Error when compiling a larger project.
Even after restarting the Editor it was still there.

Error 478 in (0:000):  Resource file error

and the Error was gone.
Then i changed the


and the Error is still gone.
No other changes in the Code.

Thats why i call this "PowerBasic Adventure".

ChatGPT gives good advice what to do:

QuoteThe "Error 478 in (0:000): Resource file error" message in PowerBasic typically indicates a problem with one of the resource files used by your application. Resource files are used to store graphical and other resources that your application may need, such as icons, bitmaps, strings, and dialog box templates.

Here are some steps you can take to troubleshoot and fix the error:

Check that the resource file exists: Make sure that the resource file that is causing the error actually exists in the location that your program is looking for it. If the file is missing, your program won't be able to load the resources it needs.

Check the syntax of your resource file: Resource files are written in a specific format, with each resource defined by a block of code that specifies its type, ID, and other properties. Make sure that your resource file is well-formed and doesn't contain any syntax errors. You can use a resource editor or a text editor to check the syntax of your file.

Check for conflicting resource IDs: Make sure that the resource IDs used in your file don't conflict with other resource IDs used in your program. Each resource must have a unique ID, and if two resources have the same ID, your program won't be able to load them both.

Check for corrupted resource data: If the resource file itself is corrupted, your program may not be able to load the resources it needs. Try opening the resource file in a resource editor or a text editor and checking for any obvious signs of corruption.

Rebuild the resource file: If you can't find any obvious errors in your resource file, try rebuilding it from scratch. Create a new resource file and add your resources one by one, testing your program after each addition to make sure that the error doesn't reappear.

If none of these steps help, you may need to seek additional help from the PowerBasic community or technical support.

Now i did some tests, i "remarked" all the #Resource statements and YES then the program compiles.
Next step, i un-remarked any of the 3 #Resource statements and in any case the File went into Error 478.

So i did something else, first i restarted the PB-Editor and also tried the JK-Editor.
Restarting the Editor did not help

Next i restarted the Computer, and compiled immediately after restart - and it compiled.

Saving files ...   -> ok
Compiling - wait ....
PowerBASIC 11 for Windows:
Beta Test Version  <Strictly Confidential>
Build #008 - License expires: November3, 2012

Primary source: *****   {396135 total lines}
Target compilation:  ****
Compile time:  9.7 seconds, at 2450319 lines/minute  -  Total Time: 12.93 seconds

Successfully created "****.exe"

Now after some time and changes to the Code I expect the Error to return.

Thats why i call this "PowerBasic Adventure".