error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi All,
I am using visual c++ express edition, I cant <span>complice in a debug as i have the following errors:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<br/>
<br/>
error C2143: syntax error : missing ; before ^

The error are jumping on this line:

<div style="color:black; background-color:white
<pre><span style="color:blue private: SplitContainerFix^ splitContainerFix1;
[/code]


<br/>
And there are other errors I am getting:
error C2227: left of ->TabIndex must point to class/struct/union/generic type

error C2227: left of ->SuspendLayout must point to class/struct/union/generic type
error C2227: left of ->SplitterDistance must point to class/struct/union/generic type
error C2227: left of ->Size must point to class/struct/union/generic type
error C2227: left of ->ResumeLayout must point to class/struct/union/generic type
error C2227: left of ->Name must point to class/struct/union/generic type
error C2227: left of ->Location must point to class/struct/union/generic type
error C2227: left of ->Dock must point to class/struct/union/generic type
error C2061: syntax error : identifier SplitContainerFix
error C2039: splitContainerFix1 : is not a member of WindowsApplication1::Form1

The errors are jumping in each line:

<div style="color:black; background-color:white
<pre> <span style="color:blue this->splitContainerFix1 = (<span style="color:blue gcnew SplitContainerFix());
<span style="color:blue this->splitContainerFix1->SuspendLayout();
<span style="color:blue this->SuspendLayout();
<span style="color:green //
<span style="color:green // splitContainerFix1
<span style="color:green //
<span style="color:blue this->splitContainerFix1->Dock = System::Windows::Forms::DockStyle::Fill;
<span style="color:blue this->splitContainerFix1->Location = System::Drawing::Point(0, 0);
<span style="color:blue this->splitContainerFix1->Name = L<span style="color:#a31515 "splitContainerFix1";
<span style="color:blue this->splitContainerFix1->Size = System::Drawing::Size(292, 266);
<span style="color:blue this->splitContainerFix1->SplitterDistance = 97;
<span style="color:blue this->splitContainerFix1->TabIndex = 0;
[/code]

<br/>
<br/>


Form1:

<div style="color:black; background-color:white
<pre>#pragma once


<span style="color:blue namespace WindowsApplication1 {

<span style="color:blue using <span style="color:blue namespace System;
<span style="color:blue using <span style="color:blue namespace System::ComponentModel;
<span style="color:blue using <span style="color:blue namespace System::Collections;
<span style="color:blue using <span style="color:blue namespace System::Windows::Forms;
<span style="color:blue using <span style="color:blue namespace System::Data;
<span style="color:blue using <span style="color:blue namespace System::Drawing;

<span style="color:green /// <summary>
<span style="color:green /// Summary for Form1
<span style="color:green ///
<span style="color:green /// WARNING: If you change the name of this class, you will need to change the
<span style="color:green /// Resource File Name property for the managed resource compiler tool
<span style="color:green /// associated with all .resx files this class depends on. Otherwise,
<span style="color:green /// the designers will not be able to interact properly with localized
<span style="color:green /// resources associated with this form.
<span style="color:green /// </summary>
<span style="color:blue public <span style="color:blue ref class Form1 : <span style="color:blue public System::Windows::Forms::Form
{
<span style="color:blue public:
Form1(<span style="color:blue void)
{
InitializeComponent();
<span style="color:green //
<span style="color:green //TODO: Add the constructor code here
<span style="color:green //
}

<span style="color:blue protected:
<span style="color:green /// <summary>
<span style="color:green /// Clean up any resources being used.
<span style="color:green /// </summary>
~Form1()
{
<span style="color:blue if (components)
{
<span style="color:blue delete components;
}
}
<span style="color:blue private: SplitContainerFix^ splitContainerFix1;
<span style="color:blue protected:
<span style="color:blue protected:

<span style="color:blue protected:

<span style="color:blue private:
<span style="color:green /// <summary>
<span style="color:green /// Required designer variable.
<span style="color:green /// </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
<span style="color:green /// <summary>
<span style="color:green /// Required method for Designer support - do not modify
<span style="color:green /// the contents of this method with the code editor.
<span style="color:green /// </summary>
<span style="color:blue void InitializeComponent(<span style="color:blue void)
{
<span style="color:blue this->splitContainerFix1 = (<span style="color:blue gcnew SplitContainerFix());
<span style="color:blue this->splitContainerFix1->SuspendLayout();
<span style="color:blue this->SuspendLayout();
<span style="color:green //
<span style="color:green // splitContainerFix1
<span style="color:green //
<span style="color:blue this->splitContainerFix1->Dock = System::Windows::Forms::DockStyle::Fill;
<span style="color:blue this->splitContainerFix1->Location = System::Drawing::Point(0, 0);
<span style="color:blue this->splitContainerFix1->Name = L<span style="color:#a31515 "splitContainerFix1";
<span style="color:blue this->splitContainerFix1->Size = System::Drawing::Size(292, 266);
<span style="color:blue this->splitContainerFix1->SplitterDistance = 97;
<span style="color:blue this->splitContainerFix1->TabIndex = 0;
<span style="color:green //
<span style="color:green // Form1
<span style="color:green //
<span style="color:blue this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
<span style="color:blue this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
<span style="color:blue this->ClientSize = System::Drawing::Size(292, 266);
<span style="color:blue this->Controls->Add(<span style="color:blue this->splitContainerFix1);
<span style="color:blue this->Name = L<span style="color:#a31515 "Form1";
<span style="color:blue this->Text = L<span style="color:#a31515 "Form1";
<span style="color:blue this->splitContainerFix1->ResumeLayout(<span style="color:blue false);
<span style="color:blue this->ResumeLayout(<span style="color:blue false);

}
#pragma endregion
};
}
[/code]

<br/>
<br/>


Class1:

<div style="color:black; background-color:white
<pre>#pragma once

<span style="color:blue using <span style="color:blue namespace System;
<span style="color:blue using <span style="color:blue namespace System::Collections;
<span style="color:blue using <span style="color:blue namespace System::Collections::Generic;
<span style="color:blue using <span style="color:blue namespace System::Data;
<span style="color:blue using <span style="color:blue namespace System::Drawing;
<span style="color:blue using <span style="color:blue namespace System::Diagnostics;
<span style="color:blue using <span style="color:blue namespace System::Windows::Forms;
<span style="color:blue using <span style="color:blue namespace System::ComponentModel;

<span style="color:green /// <summary>
<span style="color:green /// This class is a workaround for a known VS2005 SplitContainer bug.
<span style="color:green /// The designer will set Panel2MinSize before setting the control Size,
<span style="color:green /// and this causes a exception to be thrown.
<span style="color:green /// The solution used here is to store the Panel2MinSize and set it in after the size is set.
<span style="color:green /// Use this code at your own risk, as I make no warrenty of any kind.
<span style="color:green /// You are free to use this code however you like.
<span style="color:green /// </summary>
<span style="color:blue private <span style="color:blue ref class SplitContainerFix : SplitContainer
{
<span style="color:blue public:
SplitContainerFix()
{
m_panel2MinSize = SplitContainer::Panel2MinSize;
}

<span style="color:blue property <span style="color:blue int Panel2MinSize
{
<span style="color:blue int get() <span style="color:blue new
{
<span style="color:blue if (isSized)
{
<span style="color:blue return SplitContainer::Panel2MinSize;
}
<span style="color:blue return m_panel2MinSize;
}
<span style="color:blue void set(<span style="color:blue int <span style="color:blue value) <span style="color:blue new
{
m_panel2MinSize = <span style="color:blue value;
<span style="color:blue if (isSized)
{
SplitContainer::Panel2MinSize = m_panel2MinSize;
}
}
}

<span style="color:blue property System::Drawing::Size Size
{
System::Drawing::Size get() <span style="color:blue new
{
<span style="color:blue return SplitContainer::Size;
}
<span style="color:blue void set(System::Drawing::Size <span style="color:blue value) <span style="color:blue new
{
SplitContainer::Size = <span style="color:blue value;
<span style="color:blue if (! isSized)
{
isSized = <span style="color:blue true;
<span style="color:blue if (m_panel2MinSize != 0)
{
Panel2MinSize = m_panel2MinSize;
}
}
}
}

<span style="color:blue private:
<span style="color:blue int m_panel2MinSize;
<span style="color:blue bool isSized;
};
[/code]

<br/>
<br/>
<br/>
I am not sure where the trouble is, but I guess that there must be something wrong in the class1.
Please can you help?
thanks in advance.

View the full article
 
Back
Top