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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:11:52+00:00 2026-05-26T10:11:52+00:00

I have some code here which reads from a file, and stores them in

  • 0

I have some code here which reads from a file, and stores them in a vector.

I wish to pass this vector to another class. However, when i try to do that, it gives me a strange error, which i do not fully understand. It seems to be saying that the vector is not declared.

Here is the first few lines of a very long error:

 g++ C_Main.cpp C_HomePage.cpp C_SelectionPage.cpp -o Project
     C_HomePage.cpp:286:40: error: no ‘std::vector<std::basic_string<char> > HomePage::getDutiesList()’ member function declared in class ‘HomePage’
    C_HomePage.cpp:290:26: error: ‘std::vector<std::basic_string<char> > HomePage::getResourcesList’ is not a static member of ‘class HomePage’
    C_HomePage.cpp:290:26: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x
    C_HomePage.cpp:291:2: error: expected primary-expression before ‘return’
    C_HomePage.cpp:291:2: error: expected ‘}’ before ‘return’
    C_HomePage.cpp:291:2: error: in C++98 ‘HomePage::getResourcesList’ must be initialized by constructor, not by ‘{...}’
    C_HomePage.cpp:291:2: error: no matching function for call to ‘std::vector<std::basic_string<char> >::vector(<brace-enclosed initializer list>)’

Here is line 282 – line 292 of C_HomePage.cpp

int HomePage::getInitPoints(){ 
    return initPoints; 
}

vector<string> HomePage::getDutiesList(){
    return dutiesList;
}

vector<string> HomePage::getResourcesList{
    return resourcesList;
}

Here is the corresponding declarations for those methods in H_HomePage.h

class HomePage {
        //These values will be the property of the flat
        //They are set before the login screen is displayed
        string manager;
        int initPoints;
        vector<string> dutiesList;
        vector<string> resourcesList;
        vector<FlatMember> flatMemberList;
        string loginName;


        public:

            HomePage(string);

            void login(string);
            string receivePassword();

            void importFlatMembers(string);
            void exportFlatMembers(string);         

            string getLoginName();
            string getManager();
            int getInitPoints();
            vector<string> getDutiesList;
            vector<string> getResourcesList;

};

I honestly does not know what is wrong, and have spent many hours getting frustrated over it already. Could someone please help?

  • 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-26T10:11:53+00:00Added an answer on May 26, 2026 at 10:11 am

    You’re missing parentheses in the declarations of getDutiesList and getResourcesList:

    vector<string> getDutiesList();
    vector<string> getResourcesList();
    

    EDIT: You’re also missing the parentheses in your .cpp file:

    vector<string> HomePage::getResourcesList(){
        return resourcesList;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing some code which reads file names from an sd-card (using FatFs) and
I have some code here which works perfectly in firefox but not in chrome
Here's my problem - I have some code like this: <mx:Canvas width=300 height=300> <mx:Button
I have a javascript file that reads another file which may contain javascript fragments
I have some code here. I recently added this root_id parameter. The goal of
We have some old C code here that's built with nmake. Is there an
I have some code where I'm returning an array of objects. Here's a simplified
I have some code that is using SyncEnumerator. As you can see here ,
I am trying to reduce some code here. I will explain how I have
I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does

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.