My code was working Great! until i added a vector named "resudibus"to my namespace in a windows form.

#pragma once
#include <Windows.h>
#include <msclr\marshal.h>
#include <iostream>
#include <string.h>
#include <vector>
#include <fstream>
using namespace std;
using namespace System;
using namespace System::IO;
using namespace msclr::interop;

namespace Project1 {

    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>
    /// Summary for MyForm
    /// </summary>

    std::vector<int> resudibus(1);

it gives me the following error messages :
WinCLI.obj : error LNK2005: "class std::vector<int,class std::allocator<int> > Project1::resudibus" (?resudibus@Project1@@3V?$vector@HV?$allocator@H@std@@@std@@A) already defined in MyForm.obj

1>fatal error LNK1169: one or more multiply defined symbols found

But i am sure that i havent declared this file anywhere else, when i remove it everything starts to work as usual... What am i doing wrong here?

ooo... that's definitely wrong.

Can you pleas help me sir

I was just joking, that is to say, I'm less than amateurish in C++. If I could have helped you, I'd have written a suggestion or something from the very beginning, without teasing you. So we should wait for other more... professional results.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.