Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8571871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:52:40+00:00 2026-06-11T18:52:40+00:00

I’m writing a program that includes a secondary form using C++/CLI in Visual Studio

  • 0

I’m writing a program that includes a secondary form using C++/CLI in Visual Studio 2005. So far, I haven’t progressed much due to a pair of redefinition errors that don’t make much sense.

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'

I’ve only declared each of these once, in just one namespace. One was even pre-generated by the compiler. Is there anything I can do to fix this besides starting from scratch? Any help would be much appreciated. (Code below)

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) {
         }
};
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:52:42+00:00Added an answer on June 11, 2026 at 6:52 pm

    Your error is that you define the check variable in the header file:

    namespace NameManipulator {
        int check = 4;
        // Error in the line above
    

    Change it to a declaration, as this:

    namespace NameManipulator {
        extern int check;
    

    and add the definition in a source file:

    int NameManipulator::check = 4;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.