Author Topic: [SOLVED] C++ compilation failed (error: 'LABEL_#' does not name a type)  (Read 3274 times)

0 Members and 1 Guest are viewing this topic.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
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.
« Last Edit: May 23, 2019, 08:34:59 am by odin »

FellippeHeitor

  • Guest
Re: C++ compilation failed under QB 1.3
« Reply #1 on: May 23, 2019, 07:48:53 am »
Did you create a data block after subs?

Marked as best answer by Petr on May 23, 2019, 04:15:48 am

FellippeHeitor

  • Guest
Re: C++ compilation failed under QB 1.3
« Reply #2 on: May 23, 2019, 07:49:36 am »
Or maybe there's a stray "4" typed somewhere?

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: C++ compilation failed under QB 1.3
« Reply #3 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.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: C++ compilation failed under QB 1.3
« Reply #4 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!

FellippeHeitor

  • Guest
Glad to hear it's solved :-)

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
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
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/