Help using Boost Graph Library with C++Builder 6
Hi, Has anyone successfully used to Boost Graph Library (BGL) with C++Builder 6? I'm getting compilation errors. Here's what I've done: I downloaded the latest Boost (1.30.0) from boost.org and installed it. I then tried to compile the quick-tour.cpp file using the mingw compiler - no problem. I then tried to compile using the C++Builder IDE and I get the following compile errors: [C++ Error] tuple_basic.hpp(158): E2238 Multiple declaration for 'element<N,T>' [C++ Error] tuple_basic.hpp(143): E2344 Earlier declaration of 'element<N,T>' I also tried using the command line compiler (bcc32.exe - version 5.6), but get the same errors (and more). Can someone tell me what I'm doing wrong? Do I need to do something special to prepare the boost libraries for use with Borland (e.g., using the Boost Jam stuff)? Some of the documentation said I should only have to set the include path. This seemed to work with mingw. Thanks, Craig
Yes, I have the same problem with Boost1.30.0/Borland C++ Builder 5. To be more precise, when I try to compile the following: //---------------------------------------------- #include<boost/tuple/tuple.hpp> int main(int argc, char* argv[]) { return 0; } //---------------------------------------------- , I get these errors: [C++ Fehler] tuple_basic.hpp(158): E2434 In Template-Deklaration fehlen Template-Parameter ('template<...>') [C++ Fehler] tuple_basic.hpp(158): E2238 Bezeichner 'element<N,T>' mehrfach deklariert [C++ Fehler] tuple_basic.hpp(143): E2344 'element<N,T>' bereits deklariert (in english, they should read something like: E2434 Template declaration missing template parameters ('template<...>') E2238 Multiple declaration of 'element<N,T>' E2344 'element<N,T>' already declared ) As a very crude way to fix the problem, I commented out the const-specializations of the element template in tuple.hpp: //template<int N, class T> //struct element<N, const T> //{ //private: // typedef typename T::tail_type Next; // typedef typename element<N-1, Next>::type unqualified_type; //public: // typedef typename boost::add_const<unqualified_type>::type type; //}; //template<class T> //struct element<0,const T> //{ // typedef typename boost::add_const<typename T::head_type>::type type; //}; Now I can at least compile code using tuples. (e.g. the knights-tour example from boost). Does anyone have a more elegant workaround? Is this a bug that I should submit or is it already known? Does anyone know if reverting to an older version of boost will solve the problem? Questions, questions... :-) CU, Elmar Bihler.
Elmar Bihler wrote:
Yes, I have the same problem with Boost1.30.0/Borland C++ Builder 5. To be more precise, when I try to compile the following:
I can't help with BCB5, but FYI, your example compiles fine in BCB6. Russell
--- In Boost-Users@yahoogroups.com, Russell Hind <yg-boost- users@m...> wrote:
Elmar Bihler wrote:
Yes, I have the same problem with Boost1.30.0/Borland C++ Builder
5.
To be more precise, when I try to compile the following:
I can't help with BCB5, but FYI, your example compiles fine in BCB6.
Russell
I had this same compilation problem - even with BCB6 - until I installed BCB6 Update #4. This same problem rears its ugly head when trying to use the Boost Graph Library (which must depend on the tuple library). -Craig
--- In Boost-Users@yahoogroups.com, "asterixthegaul2003" <craig.jackson@m...> wrote: ...
I then tried to compile using the C++Builder IDE and I get the following compile errors:
[C++ Error] tuple_basic.hpp(158): E2238 Multiple declaration for 'element<N,T>' [C++ Error] tuple_basic.hpp(143): E2344 Earlier declaration of 'element<N,T>'
FYI... I solved my own problem. It appears that BCB6 wasn't having trouble with the BGL, but rather the tuple library. Installing BCB6 Update #4 seems to have fixed the problem. Craig
participants (3)
-
asterixthegaul2003
-
Elmar Bihler
-
Russell Hind