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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:10:41+00:00 2026-06-11T05:10:41+00:00

I have a bytebuffer class, written in c++ by myself, i can compile it

  • 0

I have a bytebuffer class, written in c++ by myself, i can compile it and it works as it should. Now i would like to use it in a big project, but when i include it in an another header, it throws an error if i try to build it. Here is the error:

  CXX    out.o
In file included from /usr/include/c++/4.6/streambuf:808:0,
                 from /usr/include/c++/4.6/ios:44,
                 from /usr/include/c++/4.6/ostream:40,
                 from /usr/include/c++/4.6/iostream:40,
                 from /path/to/file/src/someheader1.h:29,
                 from /path/to/file/src/someheader2.h:31,
                 from /path/to/file/src/somesource.cpp:24:
/usr/include/c++/4.6/bits/streambuf.tcc: In member function ‘virtual std::streamsize std::basic_streambuf<_CharT, _Traits>::xsgetn(std::basic_streambuf<_CharT, _Traits>::char_type*, std::streamsize)’:
/usr/include/c++/4.6/bits/streambuf.tcc:56:38: error: expected unqualified-id before ‘(’ token
/usr/include/c++/4.6/bits/streambuf.tcc: In member function ‘virtual std::streamsize std::basic_streambuf<_CharT, _Traits>::xsputn(const char_type*, std::streamsize)’:
/usr/include/c++/4.6/bits/streambuf.tcc:90:38: error: expected unqualified-id before ‘(’ token
In file included from /usr/include/c++/4.6/istream:859:0,
                 from /usr/include/c++/4.6/iostream:41,
                 from /path/to/file/src/someheader1.h:29,
                 from /path/to/file/src/someheader2.h:31,
                 from /path/to/file/src/somesource.cpp:24:
/usr/include/c++/4.6/bits/istream.tcc: In member function ‘std::streamsize std::basic_istream<_CharT, _Traits>::readsome(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize)’:
/usr/include/c++/4.6/bits/istream.tcc:693:46: error: expected unqualified-id before ‘(’ token
make[4]: *** [out.o] Error 1

The skeleton of the header file in the project:

#ifndef _GUARD_
#define _GUARD_

#include <string>
#include <vector>

...

#include "bytebuffer.h"

namespace A {
  namespace B {

    using namespace std;
    using namespace A::C;

    class Myclass {
    public: 

    ...

     virtual void save( ByteBuffer& bb ) {
     }

     ...    

    } ;
  }
}

#endif  

The byte buffer is realy simple, it contains a vector for data, and put and get methods for different types. If i comment out the save method in the header, nothing changes, so i don’t even have to declare a byte buffer, it throws the error. What could cause this?

  • 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-11T05:10:43+00:00Added an answer on June 11, 2026 at 5:10 am

    Look at this error:

    /usr/include/c++/4.6/bits/streambuf.tcc:56:38: error: expected unqualified-id before ‘(’ token
    

    I happen to have this (hopefully) very same file around and line 56 is:

    const streamsize __len = std::min(__buf_len, __remaining);
                                  ^
                                  col 38
    

    I marked also the column 38, for the reader convenience.

    Oh! The error talks about a ( token but in this position there is not a ( but a min. So my guess is that some header in your project is defining a macro min:

    #define min(a, b) ((a) < (b) ? (a) : (b))
    

    or similar.

    The solution is to find this header, and remove the macro altogether (my favorite), or rename it (into MIN?), or else move the include of that header after all the standard includes (not always easy).

    As a footnote, the MS ubiquitous <windows.h> is known for having such a macro… maybe someone copied a little?

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

Sidebar

Related Questions

I have a class constructor like this: public JavoImageCorrectedDataHeader() { ByteBuffer buffer = ByteBuffer.allocate(this.size());
have written this little class, which generates a UUID every time an object of
I'm using Socket class for my web client. I can't use HttpWebRequest since it
I have a CRC class written in VB.NET. I need it in C#. I
I have a class for IO that uses ByteBuffer to buffer access to a
how we can convert a pdf file to single jpeg? now i have using
I have the following in a java file (MyRtmpClient.java): import org.apache.mina.common.ByteBuffer; and ByteBuffer is
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have written a Hello, world program with JNI. Java calls c program with
I am using hadoop-0.20.203.0rc1.tar.gz for my cluster setup. Whenever I set job.setMapOutputKeyClass(ByteBuffer.class); and run

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.