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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:14:44+00:00 2026-05-23T19:14:44+00:00

Many times I find useful code examples on the Internet. About half of the

  • 0

Many times I find useful code examples on the Internet. About half of the time they don’t specify what files to include or even what libs to include on the command line with -l. How do you usually find that out?

edit note: The problem below has been solved. The remainder of this post can be skipped.

Right now, I’m getting tons of errors while trying to compile:

53: string Gunzip::gunzip(string& compressed)
54: {
55:   namespace io = boost::iostreams;
56:
57:   io::filtering_istream gunzip;
58:   gunzip.push(io::gzip_decompressor());
59:   std::istringstream in_stream = std::istringstream(compressed);
60:   gunzip.push(in_stream);
61:
62:   stringstream strstream;
63:   io::copy(gunzip, strstream);
64:   return strstream.str();
65: }

After a day on the Internet I’m trying:

option: 3 -L/usr/include/boost
and:
 8: #include <string>
 9: #include <iostream>
10: #include <sstream>

15: #include <boost/iostreams/copy.hpp>
16: #include <boost/iostreams/device/array.hpp>
17: #include <boost/iostreams/device/back_inserter.hpp>
18: #include <boost/iostreams/filter/gzip.hpp>
19: #include <boost/iostreams/filter/test.hpp>
20: #include <boost/iostreams/filtering_stream.hpp>

The error I have is:

                 from /usr/include/c++/4.5/string:45,
                 from Gunzip.cpp:8:
/usr/include/c++/4.5/bits/ios_base.h: In copy constructor     ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’:
In file included from /usr/include/c++/4.5/bits/localefwd.h:43:0,
/usr/include/c++/4.5/bits/ios_base.h:785:5: error: ‘std::ios_base::ios_base(const     std::ios_base&)’ is private
/usr/include/c++/4.5/iosfwd:77:11: error: within this context
/usr/include/c++/4.5/iosfwd: In copy constructor     ‘std::basic_istringstream<char>::basic_istringstream(const     std::basic_istringstream<char>&)’:
/usr/include/c++/4.5/iosfwd:97:11: note: synthesized method     ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’ first required here 
/usr/include/c++/4.5/streambuf: In copy constructor     ‘std::basic_stringbuf<char>::basic_stringbuf(const std::basic_stringbuf<char>&)’:
/usr/include/c++/4.5/streambuf:773:7: error: ‘std::basic_streambuf<_CharT,     _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>::__streambuf_type&)     [with _CharT = char, _Traits = std::char_traits<char>, std::basic_streambuf<_CharT,     _Traits>::__streambuf_type = std::basic_streambuf<char>]’ is private
/usr/include/c++/4.5/iosfwd:93:11: error: within this context
/usr/include/c++/4.5/iosfwd: In copy constructor     ‘std::basic_istringstream<char>::basic_istringstream(const     std::basic_istringstream<char>&)’:
/usr/include/c++/4.5/iosfwd:97:11: note: synthesized method     ‘std::basic_stringbuf<char>::basic_stringbuf(const std::basic_stringbuf<char>&)’ first     required here 
Gunzip.cpp: In member function ‘std::string Gunzip::gunzip(std::string&)’:
Gunzip.cpp:59:65: note: synthesized method     ‘std::basic_istringstream<char>::basic_istringstream(const std::basic_istringstream<char>&)’ first required here 
make[2]: Leaving directory `/home/albert/NetBeansProjects/Arb3'
make[1]: Leaving directory `/home/albert/NetBeansProjects/Arb3'
make[2]: *** [build/Debug/GNU-Linux-x86/Gunzip.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 9s)

I can remove the first 3 includes to obtain other errors I don’t understand. I don’t know which errors are better.

  1. Is this error related to includes? How should I know? I’m blaming the includes because so far all errors were due to includes. I don’t know what basic_ios is.
  2. How do you find out what to include and what libs to use?
  • 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-23T19:14:45+00:00Added an answer on May 23, 2026 at 7:14 pm

    The short answer is ‘it depends’. For classes / functions which are part of the C++ standard library the man pages which come with your compiler will list which header(s) and libraries are required; or alternately you can use online resources such as cplusplus.com, MSDN or GNU libstdc++ doxygen docs.

    For things like Boost you have to look at their documentation; however the obvious question is ‘how do I know if a class is from boost’ – to which the answer is pretty much ‘Google it’ – over time you’ll get used to what is and isn’t in Boost.

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

Sidebar

Related Questions

I've heard about AppleScript Studio many times, but I cannot find any download links.
I need to find out how many times the number greater than or less
I know this has been asked many times but i'm yet to find a
It's a common problem, solved many times, but for some reason i cannot find
Many times I needed a set of pointers. Every time that happens, I end
Many times I use 'mqsc' for create MQ queue manager from script files but
Many times I work with optimized code (sometimes even involving vectorized loops), which contain
Many times i run time consuming PHP scripts that echo status updates like 'batch
My project is built in VB.Net Many times I find that Visual Studio has
Many times I find myself counting occurrences with Tally[ ] and then, once I

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.