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

  • Home
  • SEARCH
  • 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 7194653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:24:58+00:00 2026-05-28T20:24:58+00:00

#ifndef MIGRATINGUSER_H #define MIGRATINGUSER_H #include <iostream> using namespace std; class MigratingUser { public: void

  • 0
#ifndef MIGRATINGUSER_H
#define MIGRATINGUSER_H
#include <iostream>
using namespace std;

class MigratingUser
{
        public:
        void populateUidAndGuid(string line);
        private:
        string uid;
        string guid; 
};
#endif

that s header definition and below is cpp definition:

#include "MigratingUser.h"
using namespace std;

void MigratingUser::populateUidAndGuid(string line)
{
  //get the uid and guid
}

and this is the error i am getting. how can i resolve this:

undefined reference to MigratingUser::populateUidAndGuid(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'

for completeness this is how i use the class:

MigratingUser muser;

muser.populateUidAndGuid(temp);
  • 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-05-28T20:25:00+00:00Added an answer on May 28, 2026 at 8:25 pm

    First off, I really doubt that’s the error you’re getting, because it’s not formatted correctly. Perhaps you got something that talked about std::basic_string<char, std::char_traits<char>, std::allocator<char> >, but it’s unlikely a compiler would spit out what you posted unless you had some … interesting … code. In the future, copy and paste exactly because experts can get a surprisingly large amount of information out of details you don’t consider important. And you can badly mislead StackOverflow users if you edit incorrectly, making it much harder for them to help you.

    Now, the most likely cause of your problem is that you aren’t aware of the difference between the compile step and the link step. That “undefined reference” error is a linker error.

    This means your headers are all right – your code compiles, but you didn’t put all the object files together correctly at the end – so, the output of g+ -c MigratingUser.cpp wasn’t included with the output of g++ -c main.cpp (or whatever you named the “usage” code).

    You can do the compile and link in one go (for simple projects) like so:

    g++ -o my_executable MigratingUser.cpp main.cpp
    

    This will both compile and link the two files together.

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

Sidebar

Related Questions

I have the following class #ifndef Container_H #define Container_H #include <iostream> using namespace std;
#ifndef SLIST_H #define SLIST_H #include llist.h using namespace std; class slist:public llist{ public: slist();
#ifndef IMAGEDATA_H #define IMAGEDATA_H #include <iostream> #include <vector> class ImageData { public: std::string foo;
I have this main function: #ifndef MAIN_CPP #define MAIN_CPP #include dsets.h using namespace std;
#ifndef DELETE #define DELETE(var) delete var, var = NULL #endif using namespace std; class
#ifndef __DynTex_H__ #define __DynTex_H__ #include SdkSample.h using namespace Ogre; using namespace OgreBites; class _OgreSampleClassExport
I have a class called Fraction : #ifndef FRACTION_H #define FRACTION_H #include <iostream> using
//// header file #ifndef _SECTION_ #define _SECTION_ #include <map> #include Employee.h using namespace std;
Given this code sample: complex.h : #ifndef COMPLEX_H #define COMPLEX_H #include <iostream> class Complex
Header file is graph.h #ifndef _GRAPH_H_ #define _GRAPH_H_ #include <map> #include <vector> using namespace

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.