when I try your 1st post code, B+, I get the following:
In file included from qbx.cpp:2208:
..\\temp\\main.txt:208:1: error: 'LABEL_5' does not name a type; did you mean 'HACCEL__'?
LABEL_5:;
^~~~~~~
HACCEL__
compilation terminated due to -Wfatal-errors.
I'll try the second...
All this looks like is Cobalt's finger went to F5 but instead hit a stray '5' after a SUB and generated this error. No labels can occur after SUB/FUNCTION blocks.
So here's how I imagine it:
- Cobalt copies the code from the codebox in the forum.
- He pastes it in the IDE - cursor is now at the end of pasted code, which means it's after the last END SUB
- Cobalt tries to run with F5 - which happens to be just above key 5. Finger slips and hits 5 just before F5.
- A stray 5 label - which gets converted in the C++ code to LABEL_5:; gets added.
- Labels after SUB/FUNCTION blocks are not allowed.
- The c++ compiler tries to find something in the C++ language that kinda resembles LABEL_5:; - compiler's auto-correct at play.
- Then you get the odd error above.
Elementary, Watson.