QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Petr on May 23, 2019, 07:47:31 am

Title: [SOLVED] C++ compilation failed (error: 'LABEL_#' does not name a type)
Post by: Petr on May 23, 2019, 07:47:31 am
Hi. Please, which internal function add "LABEL" text to main.txt file? My source code is bigger than 4100 rows and contains included files and is not ready for release now....

What do this error?

In file included from qbx.cpp:2171:
..\\temp\\main.txt:10221:1: error: 'LABEL_4' does not name a type; did you mean 'HACCEL__'?
 LABEL_4:;
 ^~~~~~~
 HACCEL__
compilation terminated due to -Wfatal-errors.

 All help is very welcome.
Title: Re: C++ compilation failed under QB 1.3
Post by: FellippeHeitor on May 23, 2019, 07:48:53 am
Did you create a data block after subs?
Title: Re: C++ compilation failed under QB 1.3
Post by: FellippeHeitor on May 23, 2019, 07:49:36 am
Or maybe there's a stray "4" typed somewhere?
Title: Re: C++ compilation failed under QB 1.3
Post by: Petr on May 23, 2019, 08:02:53 am
Hi Fellippe, program contains none DATA blocks and nothing after SUB and FUNCTIONS blocks, just two included BM files, but this both are good.
Title: Re: C++ compilation failed under QB 1.3
Post by: Petr on May 23, 2019, 08:15:34 am
Oh! I'm blind as a blind bullet. Thanks a lot Fellippe. Really. On line 3820 between one SUB and FUNCTION number 4 has been forgotten, which IDE correctly evaluated as a line number. Such a thing. Thank you!
Title: Re: [SOLVED] C++ compilation failed (error: 'LABEL_#' does not name a type)
Post by: FellippeHeitor on May 23, 2019, 08:37:27 am
Glad to hear it's solved :-)
Title: Re: [SOLVED] C++ compilation failed (error: 'LABEL_#' does not name a type)
Post by: Pete on May 23, 2019, 12:25:37 pm
Ha! Just like AmeriPete, ChezPete needs to remember to wear his glasses, too! Well, my glasses are special, they're s,mart glasses. They not only let me see what I'm looking at, they also tell me what I'm looking at, like: Guy's face, Guys face, boobs, boobs... I just wish they wouldn't tell me out loud. Last time that happened when talking to a couple, the "guy's face" didn't seem too pleased.

You know C++ compilation also fails when you don't include "DYNAMIC" and USER32 in some situations where DECLARE LIBRARY is all you needed before. Weird, but it seems to depend on the functions in that library. Apparently some are recognized by QB64, and some are not. If you call a function that isn't you better darn well write out the full declare library statement.

It wouldn't be a bad idea to collect a top 10 list of why C++ compilation fails for situations like this. Unfortunately, one of our boobs who would be able to document these in the WIKI, don't come around here no more...

Pete