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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:09:29+00:00 2026-06-19T03:09:29+00:00

I get the compile error cannot call member function ‘bool GMLwriter::write(const char*, MyList<User*>&, std::vector<std::basic_string<char>

  • 0

I get the compile error

cannot call member function ‘bool GMLwriter::write(const char*, MyList<User*>&, std::vector<std::basic_string<char> >)’ without object

when I try to compile

 class GMLwriter{
    public:
    bool write(const char *fn, MyList<User*>& my_vec, vector<string>edges);
};

the function is defined later and called in main with

GMLwriter::write(argv[3], Users, edges);

Users is declared before with MyList<User*> Users; (MyList is a List ADT and I have a User class) and edges is declared with vector<string>edges

to what object is this error referring?

  • 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-19T03:09:30+00:00Added an answer on June 19, 2026 at 3:09 am

    GMLwriter::write is not static function of GMLwriter, you need to call it through object. For example:

    GMLwriter gml_writer;   
    gml_writer.write(argv[3], Users, edges);
    

    If GMLwriter::write doesn’t depend on any GMLwriter state(access any member of GMLwriter), you can make it a static member function. Then you could call it directly without object:

    class GMLwriter
    {
    public:
       static bool write(const char *fn, MyList<User*>& my_vec, vector<string>edges);
       ^^^^
    };
    

    then you could call:

    GMLwriter::write(argv[3], Users, edges);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot compile python in pydev in eclipse. I get the following error: unable
Every time I try to compile my code I get error: cannot convert parameter
We get compile time error when integer is divided by zero whereas in case
I get a compile error, which I'm slightly confused about. This is on VS2003.
When I compile my application , I get following compile error. Unable to find
In Visual Studio 2010 Pro, I get a compile error stating "expected an identifier"
I get a compile time error on countList method. public static void countList( List<?
In the following code, I get a compile time error: ByRef Argument type mismatch.
In the following code, I get a compile time error because i is treated
For the attached code, I get the following compile time error : exception during

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.