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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:06:47+00:00 2026-06-06T17:06:47+00:00

I use MinGW latest version to compile the following code. I get the folowing

  • 0

I use MinGW latest version to compile the following code. I get the folowing message

     y:/bbom/source/om0/basic/test.cpp: In static member function 'static void somecl
ass::init(class_object*)':
y:/bbom/source/om0/basic/test.cpp:68:50: error: no matching function for call to
 'class_object::add_method(void (&)(object*, arch&))'
y:/bbom/source/om0/basic/test.cpp:68:50: note: candidate is:
y:/bbom/source/om0/basic/test.cpp:27:54: note: template<class p_function> void c
lass_object::add_method(typename p_function::funcion_type)
make.exe: *** [y:/bbom/bin/om0/basic/test.a] Error 1

Here is my code undressed from every thing not needed for this question

#include <exception>

class exception : public std::exception
{
    public:
    exception() {}
    exception(const exception &);
    ~exception() throw() {}
    virtual const char *what() const throw();
};

typedef unsigned id, version;
class class_object;

class object
{
    public:
    virtual ~object() {}
    void *get_method(id);
    class_object *get_class_object();
};

class class_object : public object
{
    public:
    template <class p_function>
        void add_method(typename p_function::funcion_type p) 
            {add_method2((void *)p, p_function::function_id);}
    void add_method2(void *, id);
};

template <typename p_func, id p_id>
class function
{
    public:
    typedef p_func function_type;
    enum {function_id = p_id, };
    function(object *p) {m_func = (p_func)p->get_method(p_id);}
    p_func m_func;
};

class iface : public object
{
    public:
    iface(object *p) : m_object(p) {}
    static void init(class_object *) {}
    object *m_object;
};

class arch;
class archivable : public iface
{
    public:
    typedef void (*archive_func_type)(object *, arch &);
    typedef function<archive_func_type, 0x5afeb287> archive_type;
    archivable(object *);
    archive_type archive;
};

class someclass : public object
{
    public:
    static void archive(object *, arch &)
    {
    }
    static void init(class_object *p)
    {
        p->add_method<archivable::archive_type>(archive);
        // the compiler says this call cannot be matched to 
        // add_method declared in class 'class_object'
    }
};

What is wrong with my call to the template method in class_object::add_method<…>()

  • 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-06T17:06:49+00:00Added an answer on June 6, 2026 at 5:06 pm

    It appears you mistyped function_type as funcion_type on line 27 of test.cpp.

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

Sidebar

Related Questions

I'm trying to use NetBeans to compile C code and have the following versions
I use MinGW on Windows. I get the boost source files from svn and
After reading this article http://lukast.mediablog.sk/log/?p=155 I decided to use mingw on linux to compile
I use GNUStep to compile Objective-C on Windows 7 using GCC and MinGW. I'd
I'd like to cross-compile some open-source libraries (libiconv, gettext, glib2) for windows using mingw
i use the netbeans with MinGW and MYSY make /debugger but when i compile
I installed the latest release of MinGW/MSYS, and I like to use rxvt terminal
I am trying to use MinGW to compile a C program under Windows XP.
Is it possible to use a static library that was compiled with mingw in
I am trying to install Boost so I can use it along with MinGW

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.