Error 26 error C2061: syntax error : identifier 'Form1' c:\Users\Black Chocobo\Desktop\WaveMachine\managesongs\WaveMachine\WaveMachine\WaveMachine\WaveMachine.cpp 16

// Create the main window and run it
	Application::Run(gcnew Form1.h());

Take out the .h, that's the filename, you want to instantiate an object of type Form1. Application::Run(gcnew Form1());

its Form1.h, they are both the same... would it have anything to do with one of the other errors? this is the only error relating to the form1.cpp where as the 25 others relate to form1.h

another note, my form1.cpp is actually called WaveMachine.cpp, the reference appears to have been the same so I cannot believe that changing the .cpp name to form1 would be the issue

Edited 5 Years Ago by ethanbuckley: n/a

Which other errors?

There is no form1.cpp (unless you specifically created a file with that title), so that shouldn't matter.

The IDE should have autogenerated the code you posted above, that's why having the .h there was suspect.

There should be a line in your form1.h that says something like public ref class Form1 : public System::Windows::Forms::Form Check and make sure it says Form1 there.

Edited 5 Years Ago by jonsca: here there and everywhere

Sorry to be a pain, im beginner

I have three header files,
AddWaveTrack_form1.h
EditWaveTrack_form1.h
Form1.h (25 Errors)

And then I have my Source Files,
AddWaveTrack_form1.cpp
EditWaveTrack_form1.cpp
WaveMachine.cpp (1 Error aka this one)

Ok so I found:

public ref class Form1 : public System::Windows::Forms::Form

added a 1 onto the form at the end, this generated 50 errors one of them being:

Error 1 error C2039: 'Form1' : is not a member of 'System::Windows::Forms' c:\users\black chocobo\desktop\wavemachine\managesongs\wavemachine\wavemachine\wavemachine\Form1.h 29

does it require .h? UPDATED no change 1 extra error

Edited 5 Years Ago by ethanbuckley: n/a

the start of my form1.h goes like this:

#pragma once


#include "AddWaveTrack_form1.h"
#include "EditWaveTrack_form1.h"

namespace WaveMachine {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	using namespace System::IO;

	using namespace System::Media;

	/// <summary>
	/// Summary for Form1
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{

Edited 5 Years Ago by ethanbuckley: n/a

So, your WaveMachine.cpp file should look something like this:

// WaveMachine.cpp : main project file.

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

using namespace WaveMachine; //is this line intact?

[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;
}

Edited 5 Years Ago by jonsca: n/a

This article has been dead for over six months. Start a new discussion instead.