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 8584089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:41:20+00:00 2026-06-11T21:41:20+00:00

I am getting below error. I can not understnad where does it happening? Whre

  • 0

I am getting below error. I can not understnad where does it happening? Whre it is going wrong.
I am developing some code as,

abc.h

#include<vector>
vector<string> vect;
vector<string>::iterator ab;

def.c

#include "abc.h"

    vect.push_back("a");
    vect.push_back("b");
    for(ab = vect.begin(); ab != vect.end(); ab++)
    {
    if(*ab == "b")
    {
    FIle *file->fun();
    }

abc.c

#include "abc.h"

    File::file()
    {
    vect.insert(1, "Something");
    }

I am getting an error as

"class std::_Vector_iterator<class std::_Vector_val<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > testCase" (?testCase@@3V?$_Vector_iterator@V?$_Vector_val@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@std@@A) already defined in abc.obj
1>GTestThread.obj : error LNK2005: "class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > vect" (?vect@@3V?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@A) already defined in abc.obj
1>D:/ fatal error LNK1169: one or more multiply defined symbols found
  • 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-11T21:41:22+00:00Added an answer on June 11, 2026 at 9:41 pm

    This:

    vector<string> vect;
    vector<string>::iterator ab;
    

    is a definition in a header, meaning the you’ll break the one definition rule when you include the header in multiple translation units. Change it to:

    //abc.h
    extern vector<string> vect;
    extern vector<string>::iterator ab;
    

    to make it a declaration and move the definition in a single implementation file:

    //abc.c
    #include "abc.h"
    vector<string> vect;
    vector<string>::iterator ab;
    

    I’m still wondering how your def.c compiles, you can’t just paste statements in an implementation file outside a context.

    Also, C++ has extensions .cc or .cpp (others too I think), not .c.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting LNK2001 error. The code has been included below. Can someone please
I am getting a Value cannot be null error from the code below: @Html.Label(material.ExtendedGroup)
I am getting the below perl error. Can't use string () as a symbol
i'm getting the below error, When compiling the Asp.Net web deploy project Could not
Possible Duplicate: pthread Function from a Class I am getting an error (Can not
I'm getting below error...I'm not sure what this means as I have included helper
I can not figure out what is going wrong but on this simple PHP
I'm getting the following error for a simple function below: TypeError: document.getElementsByTagName(p)[0].innerHtml is not
On the query below I keep getting this error: Cannot read the next data
while running: rake snorby:setup getting below error: rake aborted! You have already activated rake

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.