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

The Archive Base Latest Questions

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

My compiler errors are extremely long because g++ tells me the many ‘candidates’ for

  • 0

My compiler errors are extremely long because g++ tells me the many ‘candidates’ for the functions that I am using wrong. What can I do?

server.cpp:78:51: note: candidates are:
/usr/include/boost/asio/buffer.hpp:599:26: note: boost::asio::mutable_buffers_1  boost::asio::buffer(const boost::asio::mutable_buffer&)
/usr/include/boost/asio/buffer.hpp:599:26: note:   candidate expects 1 argument, 2 provided
... 30 lines of error for one wrong line of code
  • 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:13:40+00:00Added an answer on June 6, 2026 at 5:13 pm

    C++ is a fine, heavyweight programming language, but no one has ever figured out how to get it to issue readable error messages. I am afraid that the error messages you mention are complicated because, as seen from the compiler’s perspective, the error is complicated. If you take the time to read the message carefully, and think about it a while, you may begin to understand why this must be so.

    Let’s break your error message down:

    server.cpp:78:51: note: candidates are:
    

    This means that the error seems to originate on line 78 (or is it line 51?) of server.cpp. However, the reason the compiler believes that it is an error is found in a Boost header, asio/buffer.hpp. It is probably fruitless to examine that header, since the header is probably both compicated and correct. Nevertheless, the next line of the error message extracts from the Boost header the information you need:

    note: boost::asio::mutable_buffers_1  boost::asio::buffer(const boost::asio::mutable_buffer&)
    

    So, back on line 78 of server.cpp, you have called boost::asio::buffer(), right? As an argument between parentheses, that function wants an object of type boost::asio::mutable_buffer. Did you give it one? If yes, are you sure? Evidently, for some reason, the compiler does not recognize your argument as having the correct type.

    Now let’s look at the third line of the error:

    note:   candidate expects 1 argument, 2 provided
    

    So, actually, back on line 78 of server.cpp, you have given not one but two arguments to boost::asio::buffer(). That is, you have called boost::asio::buffer(x, y) rather than boost::asio::buffer(x) — or, if you haven’t, the compiler thinks that you have.

    Trace these steps. They should solve your problem.

    For information, I fairly often get C++ error messages that fill half my screen or more. I don’t like them any more than you do, but I do understand why the compiler issues them. C++’s powerful template facility in particular makes for some pretty hefty error messages when library features are misused. It’s the nature of the language. One can do little but reconcile oneself to this nature, if one will program in C++.

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

Sidebar

Related Questions

I'm getting a compile errors, that I can't really fix. I need to create
I'd like to cause compiler errors local to methods that need to be changed
I am trying to write a socket system that is to handle extremely long
I get compiler errors in : template<class _Other1, class _Other2> _Pair_base(_Other1&& _Val1, _Other2&& _Val2)
This is one of my most dreaded C/C++ compiler errors: file.cpp(3124) : fatal error
My C++ compiler cannot understand the restrict directive. How do I suppress these errors?
I'm getting some very wierd errors. The compiler seems to want to call the
When I add #pragma GCC diagnostic error "-Wreturn-type" the compiler produces warnings, not errors
Here is an extremely simple CoreMIDI OS X application that sends MIDI data. The
I understand that using vector is a good way to store binary data when

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.