Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing C++ a GUI application using the JUCE framework. I used the proJUCER to create a new project modified it a little bit and Build the project again with MSVC, but I got a weird error from my classes (that was Auto-generated by proJUCER):

C2236 unexpected token 'class'. Did you forget a ';'?           Main.cpp   15
C2143 syntax error: missing ';' before '{'                      Main.cpp   16
C2059 syntax error: 'public'                                    Main.cpp   15 
C2059 syntax error: ';'                                         Main.cpp   15
C2447 '{': missing function header (old-style format list?)     Main.cpp   16


here's my class:
C++
class NewProjectApplication  : public JUCEApplication
{
public:
      // statements here 
      class MainWindow    : public DocumentWindow
      {
      public:
            // Statements here
      private:
            // Statements here
      };
private:
      // Statements here
};


What I have tried:

I tried googling about the errors but don't really find anything
Posted
Updated 11-Apr-18 3:26am
Comments
CHill60 11-Apr-18 9:18am    
Post the top bit of main.cpp - the problem is not in your class it's before line 15 of main.cpp, possibly in an included header

1 solution

Firstly, are you sure these are the only lines of code in the file? If this is the case, then consider checking what C++ compiler does JUCE support (and check whether the compiler you have is compatible with that JUCE version, or whatever), as I have not yet checked that. Perhaps it is JUCE that is causing the project to not build by altering the behavior somewhere.

The code works perfectly, and I have just reproduced the working sample of this, try it here, C++ Shell[^]—not using JUCE framework but just mimicking the stuff around.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900