Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual c++ 重新定义;多重初始化_Visual C++_Visual Studio 2005_C++ Cli_Visual C++ 2005 - Fatal编程技术网

Visual c++ 重新定义;多重初始化

Visual c++ 重新定义;多重初始化,visual-c++,visual-studio-2005,c++-cli,visual-c++-2005,Visual C++,Visual Studio 2005,C++ Cli,Visual C++ 2005,我正在编写一个程序,其中包含一个在VisualStudio2005中使用C++/CLI的辅助表单。到目前为止,由于一对没有多大意义的重新定义错误,我没有取得多大进展 Mode.h(12) : error C2374: 'NameManipulator::check' : redefinition; multiple initialization Mode.h(12) : see declaration of 'NameManipulator::check' Mode.h(22) : error

我正在编写一个程序,其中包含一个在VisualStudio2005中使用C++/CLI的辅助表单。到目前为止,由于一对没有多大意义的重新定义错误,我没有取得多大进展

Mode.h(12) : error C2374: 'NameManipulator::check' : redefinition; multiple initialization
Mode.h(12) : see declaration of 'NameManipulator::check'
Mode.h(22) : error C2011: 'NameManipulator::Mode' : 'class' type redefinition
Mode.h(22) : see declaration of 'NameManipulator::Mode'
我只在一个名称空间中声明了其中的每一个。一个甚至是由编译器预先生成的。除了从头开始,我还能做些什么来解决这个问题吗?任何帮助都将不胜感激。(代码如下)

使用名称空间系统;
使用名称空间System::ComponentModel;
使用名称空间系统::集合;
使用命名空间System::Windows::Forms;
使用名称空间System::Data;
使用名称空间系统::绘图;
名称空间名称操纵器{
整数检查=4;
/// 
///模式摘要
///
///警告:如果更改此类的名称,则需要更改
///托管资源编译器工具的“资源文件名”属性
///与该类所依赖的所有.resx文件关联。否则,
///设计人员将无法与本地化的应用程序正确交互
///与此表单关联的资源。
/// 
public ref类模式:public System::Windows::Forms::Form
{
公众:
模式(无效)
{
初始化组件();
//
//TODO:在此处添加构造函数代码
//
}
受保护的:
/// 
///清理所有正在使用的资源。
/// 
~Mode()
{
if(组件)
{
删除组件;
}
}
公共:系统::Windows::窗体::RadioButton ^rdoAllCaps;
公共:系统::Windows::窗体::单选按钮^rdoAllLow;
public:System::Windows::Forms::RadioButton^rdoReverse;
公共:系统::Windows::窗体::单选按钮^r非正常;
私有:系统::Windows::窗体::按钮^btnOK;
受保护的:
私人:
/// 
///必需的设计器变量。
/// 
系统::组件模型::容器^组件;
#pragma区域Windows窗体设计器生成的代码
/// 
///设计器支持所需的方法-不修改
///此方法的内容与代码编辑器一起使用。
/// 
void初始化组件(void)
{
这->rdoAllCaps=(gcnewsystem::Windows::Forms::RadioButton());
this->rdoAllLow=(gcnewsystem::Windows::Forms::RadioButton());
这->rdoReverse=(gcnewsystem::Windows::Forms::RadioButton());
这->rdoNormal=(gcnewsystem::Windows::Forms::RadioButton());
这->btnOK=(gcnewsystem::Windows::Forms::Button());
此->SuspendLayout();
// 
//rdoAllCaps
// 
此->rdoAllCaps->自动调整大小=真;
此->rdoAllCaps->位置=系统::绘图::点(12,12);
此->rdoAllCaps->名称=L“rdoAllCaps”;
这->rdoAllCaps->尺寸=系统::图纸::尺寸(75,17);
此->rdoAllCaps->TabIndex=0;
此->rdoAllCaps->文本=L“所有大写字母”;
此->rdoAllCaps->UseVisualStyleBackColor=true;
// 
//阿尔洛
// 
此->rdoAllLow->自动调整大小=真;
此->rdoAllLow->位置=系统::绘图::点(12,35);
此->rdoAllLow->名称=L“rdoAllLow”;
这->rdoAllLow->尺寸=系统::图纸::尺寸(63,17);
this->rdoAllLow->TabIndex=1;
此->rdoAllLow->文本=L“所有较低”;
此->rdoAllLow->UseVisualStyleBackColor=true;
this->rdoAllLow->CheckedChanged+=gcnewsystem::EventHandler(this,&Mode::rdoAllLow\u CheckedChanged);
// 
//天文学
// 
此->rdoReverse->自动调整大小=true;
这个->关系相反->位置=系统::绘图::点(12,58);
此->rdoReverse->名称=L“rdoReverse”;
这个->关系相反->大小=系统::绘图::大小(71,17);
此->rdoReverse->TabIndex=2;
此->关系反向->文本=L“反向”;
此->rdoReverse->UseVisualStyleBackColor=true;
this->rdoReverse->CheckedChanged+=gcnewsystem::EventHandler(this,&Mode::rdoReverse\u CheckedChanged);
// 
//非正规
// 
此->rdoNormal->AutoSize=true;
此->rdoNormal->Checked=true;
此->rdoNormal->位置=系统::绘图::点(12,81);
此->rdoNormal->Name=L“rdoNormal”;
这->规范->尺寸=系统::图纸::尺寸(73,17);
此->rdoNormal->TabIndex=3;
this->rdoNormal->TabStop=true;
此->rdoNormal->Text=L“rdoNormal”;
此->rdoNormal->UseVisualStyleBackColor=true;
// 
//btnOK
// 
这->btnOK->DialogResult=System::Windows::Forms::DialogResult::OK;
此->btnOK->位置=系统::图纸::点(32,106);
此->btnOK->名称=L“btnOK”;
此->btnOK->尺寸=系统::图纸::尺寸(33,23);
此->btnOK->选项卡索引=4;
此->确定->文本=L“确定”;
此->btnOK->UseVisualStyleBackColor=true;
// 
//模式
// 
这->自动缩放尺寸=系统::图纸::尺寸(6,13);
这->AutoScaleMode=System::Windows::Forms::AutoScaleMode::Font;
这->ClientSize=System::Drawing::Size(99138);
此->控制框=假;
此->控制->添加(此->btnOK);
此->控制->添加(此->rdoNormal);
此->控制->添加(此->rdoReverse);
此->控制->添加(此->rdoAllLow);
此->控制->添加(此->rdoAllCaps);
这->FormBorderStyle=System::Windows::Forms::FormBorderStyle::FixedSingle;
此->名称=L“模式”;
此->StartPosition=System::Windows::Forms::FormStartPosition::CenterParent;
此->文本=L“模式”;
this->Load+=gcnew System::EventHandler(this,&Mode::Mode\u Load);
此->恢复布局(错误);
此->执行布局();
}
#布拉格端区
私有:系统::Void rdoReverse_CheckedChanged(系统::对象^sender,系统::事件参数^e){
if(rdoReverse->Checked==true)
检查=3;
}
私有:系统::无效模式\u加载(系统::对象^sender)
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

namespace NameManipulator {
int check = 4;
/// <summary>
/// Summary for Mode
///
/// 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 Mode : public System::Windows::Forms::Form
{
public:
    Mode(void)
    {
        InitializeComponent();
        //
        //TODO: Add the constructor code here
        //
    }

protected:
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    ~Mode()
    {
        if (components)
        {
            delete components;
        }
    }
public: System::Windows::Forms::RadioButton^  rdoAllCaps;
public: System::Windows::Forms::RadioButton^  rdoAllLow;
public: System::Windows::Forms::RadioButton^  rdoReverse;
public: System::Windows::Forms::RadioButton^  rdoNormal;
private: System::Windows::Forms::Button^  btnOK;
protected: 

private:
    /// <summary>
    /// Required designer variable.
    /// </summary>
    System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    void InitializeComponent(void)
    {
        this->rdoAllCaps = (gcnew System::Windows::Forms::RadioButton());
        this->rdoAllLow = (gcnew System::Windows::Forms::RadioButton());
        this->rdoReverse = (gcnew System::Windows::Forms::RadioButton());
        this->rdoNormal = (gcnew System::Windows::Forms::RadioButton());
        this->btnOK = (gcnew System::Windows::Forms::Button());
        this->SuspendLayout();
        // 
        // rdoAllCaps
        // 
        this->rdoAllCaps->AutoSize = true;
        this->rdoAllCaps->Location = System::Drawing::Point(12, 12);
        this->rdoAllCaps->Name = L"rdoAllCaps";
        this->rdoAllCaps->Size = System::Drawing::Size(75, 17);
        this->rdoAllCaps->TabIndex = 0;
        this->rdoAllCaps->Text = L"ALL CAPS";
        this->rdoAllCaps->UseVisualStyleBackColor = true;
        // 
        // rdoAllLow
        // 
        this->rdoAllLow->AutoSize = true;
        this->rdoAllLow->Location = System::Drawing::Point(12, 35);
        this->rdoAllLow->Name = L"rdoAllLow";
        this->rdoAllLow->Size = System::Drawing::Size(63, 17);
        this->rdoAllLow->TabIndex = 1;
        this->rdoAllLow->Text = L"all lower";
        this->rdoAllLow->UseVisualStyleBackColor = true;
        this->rdoAllLow->CheckedChanged += gcnew System::EventHandler(this, &Mode::rdoAllLow_CheckedChanged);
        // 
        // rdoReverse
        // 
        this->rdoReverse->AutoSize = true;
        this->rdoReverse->Location = System::Drawing::Point(12, 58);
        this->rdoReverse->Name = L"rdoReverse";
        this->rdoReverse->Size = System::Drawing::Size(71, 17);
        this->rdoReverse->TabIndex = 2;
        this->rdoReverse->Text = L"rEVERSE";
        this->rdoReverse->UseVisualStyleBackColor = true;
        this->rdoReverse->CheckedChanged += gcnew System::EventHandler(this, &Mode::rdoReverse_CheckedChanged);
        // 
        // rdoNormal
        // 
        this->rdoNormal->AutoSize = true;
        this->rdoNormal->Checked = true;
        this->rdoNormal->Location = System::Drawing::Point(12, 81);
        this->rdoNormal->Name = L"rdoNormal";
        this->rdoNormal->Size = System::Drawing::Size(73, 17);
        this->rdoNormal->TabIndex = 3;
        this->rdoNormal->TabStop = true;
        this->rdoNormal->Text = L"rdoNormal";
        this->rdoNormal->UseVisualStyleBackColor = true;
        // 
        // btnOK
        // 
        this->btnOK->DialogResult = System::Windows::Forms::DialogResult::OK;
        this->btnOK->Location = System::Drawing::Point(32, 106);
        this->btnOK->Name = L"btnOK";
        this->btnOK->Size = System::Drawing::Size(33, 23);
        this->btnOK->TabIndex = 4;
        this->btnOK->Text = L"OK";
        this->btnOK->UseVisualStyleBackColor = true;
        // 
        // Mode
        // 
        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
        this->ClientSize = System::Drawing::Size(99, 138);
        this->ControlBox = false;
        this->Controls->Add(this->btnOK);
        this->Controls->Add(this->rdoNormal);
        this->Controls->Add(this->rdoReverse);
        this->Controls->Add(this->rdoAllLow);
        this->Controls->Add(this->rdoAllCaps);
        this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
        this->Name = L"Mode";
        this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
        this->Text = L"Mode";
        this->Load += gcnew System::EventHandler(this, &Mode::Mode_Load);
        this->ResumeLayout(false);
        this->PerformLayout();

    }
#pragma endregion
private: System::Void rdoReverse_CheckedChanged(System::Object^  sender, System::EventArgs^  e){
             if (rdoReverse->Checked == true)
                 check = 3;
         }
private: System::Void Mode_Load(System::Object^  sender, System::EventArgs^  e) {
         }
private: System::Void rdoAllLow_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
         }
};
}
namespace NameManipulator {
    int check = 4;
    // Error in the line above
namespace NameManipulator {
    extern int check;
int NameManipulator::check = 4;
#ifndef NAMESPACE_FILENAME_H
#define NAMESPACE_FILEMANE_H
#include <iostream>
#include "helperFile.h"


/* you code and stuff here  */

#endif