Today we've been starting to use C++ and we've encountered a problem with creating our form.
I've been looking at a video which contains a tutorial how to make a Form in C++. I'm used to use C# instead of C++, so I'm really a beginner of the beginning. I've set my SubSystem to Windows and my EntryPoint to main.
I've used this code:
#include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void main(array<String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Project1::MyForm form;
Application::Run(%form);
}
In the MyForm.cpp
The errors:
Error 5 error C2065: 'form' : undeclared identifier
Error 6 error C2065: 'form' : undeclared identifier
Error 3 error C2065: 'MyForm' : undeclared identifier
Error 4 error C2146: syntax error : missing ';' before identifier 'form'
Error 2 error C2653: 'Project1' : is not a class or namespace name
8 IntelliSense: expected a ';'
9 IntelliSense: identifier "form" is undefined
7 IntelliSense: name followed by '::' must be a class or namespace name
Warning 1 warning C4829: Possibly incorrect parameters to function main. Consider 'int main(Platform::Array^ argv)'
I apologise for not posting an image due to my lack of reputation...
I haven't configured anything further than this. Am I missing something?
Thanks in advance!
Kind regards,
Sjors
array<String^>^is mainly a C++/CLI type, but the type recommended by IntelliSense,Platform::Array, is a C++/CX type. Are you sure you're using the right compiler? - Medinoc