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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:41:54+00:00 2026-06-01T16:41:54+00:00

I am decoding bencode, and have some code which works well with gcc 4.4.

  • 0

I am decoding bencode, and have some code which works well with gcc 4.4. But having recently upgraded to gcc 4.6 this code no longer builds:

#ifndef BENCODE_VALUETYPES_H
#define BENCODE_VALUETYPES_H

#include <boost/variant.hpp>

#include <string>
#include <vector>
#include <map>

namespace bencode {

  typedef boost::make_recursive_variant<
    int,
    std::string,
    std::vector<boost::recursive_variant_>,
    std::map<std::string, boost::recursive_variant_> >::type Value;

  typedef std::map<std::string, Value> ValueDictionary;
  typedef std::vector<Value> ValueVector;

};

#endif

g++ gives this error message:

/usr/include/c++/4.6/bits/stl_pair.h: In instantiation of 'std::pair<const std::basic_string<char>, boost::recursive_variant_>':
Decoder.cpp:97:39:   instantiated from here
/usr/include/c++/4.6/bits/stl_pair.h:93:11: error: 'std::pair<_T1, _T2>::second' has incomplete type
/usr/include/boost/variant/variant_fwd.hpp:232:12: error: forward declaration of 'struct boost::recursive_variant_'

The documentation for the latest boost version (1.48 at the moment) states that “due to standard conformance issues in several compilers, make_recursive_variant is not universally supported”, and that you should use the recursive_wrapper instead. But I am having problem making the change: does anyone know what this should look like using the wrapper?

  • 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-01T16:41:56+00:00Added an answer on June 1, 2026 at 4:41 pm

    Try defining below in your header file before you include boost variant headers.

    #define BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT
    #include <boost/variant.hpp>
    

    I had the same issue and found solution at boost variant recursive

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

Sidebar

Related Questions

I'm now doing some work with decoding MP3 files, but just have some basic
I tried decoding this base64 string so many times but every time i get
While working on decoding some video streaming standards I have noticed a lot of
I perform some decoding process in the native code and call a Java method
I have read that decoding the potentially long string which can be returned from
I noticed that some of my gzip decoding code seemed to be failing to
I have searched a lot about UTF8 decoding, but not found the answer yet.
I have some problem for decoding image data from base 64 encoded string. I
I have problems decoding several Chars. In the Database, the Chars Ä, Ö and
I'm wondering about MP3 decoding/encoding, and I was hoping to pull this off in

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.