Quick Question!

// Project1.cpp : main project file.

#include "stdafx.h"
#include "Form1.h"

using namespace Project1;

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);

// Create the main window and run it
Application::Run(gcnew Form1());
return 0;
}

I'm getting an error saying:
fatal error C1075: end of file found before the left brace '{'
Does anyone know how to fix this?
Last edited on
closed account (Dy7SLyTq)
put in the missing {
I haven't been able to find a missing brace?
I have one for you:

 
{
The missing brace might be in your header file
Okay, I'll check in my header file.
closed account (Dy7SLyTq)
@disch: but wouldnt it say in the header file? excuse my ignorace, but i use mingw, not visual studios so i dont know the speficity (?) of the error commands. i only ask because i know gcc does
@DTSCode: Not necessarily. It's perfectly legal for a header to have mismatching {braces}. Remember header files are not compiled, they're #included. #include is a glorified copy/paste.

This is perfectly legal:

1
2
// a.h
{

1
2
// b.h
}

1
2
3
4
5
6
// main.cpp

int main()
#include "a.h"
    return 0;
#include "b.h" 
closed account (Dy7SLyTq)
oh duh... because a macro literally expands the command with what its getting replaced by right?
#include is a preprocessor directive. One uses the #define preprocessor directive to create a preprocessor macro.

You've got the right idea. The terminology is a little off.
Last edited on
closed account (Dy7SLyTq)
sorry i shouldnt have used macro.
I found the missing brace. Didn't realize it could be in the header file.
Topic archived. No new replies allowed.