visual studio 2010 error help needed
-
Those changes are completely wrong. You have removed the
using
keywords, and added lots of unnecessary brace characters. I suggest you create a new clean Form project from the Visual Studio templates.Hi, If I use using then I get the following errors-
error : expected namespace name
using namespace System; ^
error : use of undeclared identifier 'System'
using namespace System::ComponentModel;
^
error : expected namespace name
using namespace System::ComponentModel;
^
error : use of undeclared identifier 'System'
using namespace System::Collections;
^
and so on....including buttons...So, I used the namespace with curly braces{} suggested somewhere on the net Using that I don't get these errors but then I have trouble with Public keyword. what can I do? Is clang compiler doing this?
-
Hi, If I use using then I get the following errors-
error : expected namespace name
using namespace System; ^
error : use of undeclared identifier 'System'
using namespace System::ComponentModel;
^
error : expected namespace name
using namespace System::ComponentModel;
^
error : use of undeclared identifier 'System'
using namespace System::Collections;
^
and so on....including buttons...So, I used the namespace with curly braces{} suggested somewhere on the net Using that I don't get these errors but then I have trouble with Public keyword. what can I do? Is clang compiler doing this?
VScoder12 wrote:
So, I used the namespace with curly braces{} suggested somewhere on the net
Don't. Using information from the internet without knowing what you are doing is not the way to get your program to work. I am beginning to suspect that you are not using the CLR option on your project, so the compiler thinks this is unmanaged C++. Check your settings again.
-
VScoder12 wrote:
So, I used the namespace with curly braces{} suggested somewhere on the net
Don't. Using information from the internet without knowing what you are doing is not the way to get your program to work. I am beginning to suspect that you are not using the CLR option on your project, so the compiler thinks this is unmanaged C++. Check your settings again.
I used Visual C++ > CLR > Windows Forms Application in my project creation I think it is not recognizing the System namespace If I use curly braces i think it recognizes System namespace but then it does not recognize the Private keyword any suggestion?
-
I used Visual C++ > CLR > Windows Forms Application in my project creation I think it is not recognizing the System namespace If I use curly braces i think it recognizes System namespace but then it does not recognize the Private keyword any suggestion?
VScoder12 wrote:
any suggestion?
Not really. I have just created a new Windows Forms application using Visual C++ 2010 Express, and it creates the correct files, and compiles without error. I can only assume that something is missing from your Visula Studio setup that causes these errors. The generated code of the two main files is as follows, you could try it in your system.:
// Form1.h
#pragma oncenamespace WinForm {
using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// /// Summary for Form1 /// public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// /// Clean up any resources being used. /// ~Form1() { if (components) { delete components; } } private: /// /// Required designer variable. /// System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// void InitializeComponent(void) { this->components = gcnew System::ComponentModel::Container(); this->Size = System::Drawing::Size(300,300); this->Text = L"Form1"; this->Padding = System::Windows::Forms::Padding(0); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; } #pragma endregion };
}
// WinForm.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"using namespace WinForm;
[STAThreadAttribute]
int main(array ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);// Create the main window and run it Application::Ru
-
VScoder12 wrote:
any suggestion?
Not really. I have just created a new Windows Forms application using Visual C++ 2010 Express, and it creates the correct files, and compiles without error. I can only assume that something is missing from your Visula Studio setup that causes these errors. The generated code of the two main files is as follows, you could try it in your system.:
// Form1.h
#pragma oncenamespace WinForm {
using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// /// Summary for Form1 /// public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// /// Clean up any resources being used. /// ~Form1() { if (components) { delete components; } } private: /// /// Required designer variable. /// System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// void InitializeComponent(void) { this->components = gcnew System::ComponentModel::Container(); this->Size = System::Drawing::Size(300,300); this->Text = L"Form1"; this->Padding = System::Windows::Forms::Padding(0); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; } #pragma endregion };
}
// WinForm.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"using namespace WinForm;
[STAThreadAttribute]
int main(array ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);// Create the main window and run it Application::Ru
-
if i use win32 then mine also compile and runs successfully but i am having trouble with compiling/building with clang compiler as mentioned earlier
Clang doesn't support C++/CLI, while Microsoft's compilers do. That's the issue.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
if i use win32 then mine also compile and runs successfully but i am having trouble with compiling/building with clang compiler as mentioned earlier
-
VScoder12 wrote:
clang compiler
What is that, and what does it have to do with Visula Studio?
Clang Compiler[^] An open-source compiler.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
Clang Compiler[^] An open-source compiler.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
VScoder12 wrote:
So, I used the namespace with curly braces{} suggested somewhere on the net
Don't. Using information from the internet without knowing what you are doing is not the way to get your program to work. I am beginning to suspect that you are not using the CLR option on your project, so the compiler thinks this is unmanaged C++. Check your settings again.
[High Class Asian Escort](http://www.independentasianangels.co.uk/)