VC++ 6.0 ,SGI STL and Boost
I'm just trying to include the files for the shared_ptr class and keep having problems. I was able to fix a problem with a duplicate definition of 'max' and 'min' (in suffix.hpp, it was conflicting with a file from the SGI STL implementation) I mainly just commented it out, if someone has a better plan on how to fix it I would love to know how to fix it. I have tried Boost 1.28 and 1.29 and still got the same set of errors. In addition to the 'max' and 'min' conflict I am getting these errors : e:\programming projects\c++ projects\boost_1_28_0\boost\checked_delete.hpp(24) : error C2061: syntax error : identifier 'T' e:\programming projects\c++ projects\boost_1_28_0\boost\checked_delete.hpp(24) : error C2061: syntax error : identifier 'T' e:\programming projects\c++ projects\boost_1_28_0\boost\checked_delete.hpp(30) : error C2061: syntax error : identifier 'T' e:\programming projects\c++ projects\boost_1_28_0\boost\checked_delete.hpp(30) : error C2061: syntax error : identifier 'T' e:\programming projects\c++ projects\boost_1_28_0\boost\detail\shared_count.hpp(184) : error C2504: 'counted_base' : base class undefined e:\programming projects\c++ projects\boost_1_28_0\boost\detail\shared_count.hpp(206) : see reference to class template instantiation 'detail::counted_base_impl
' being compiled e:\programming projects\c++ projects\boost_1_28_0\boost\detail\shared_count.hpp(253) : error C2061: syntax error : identifier 'Y' e:\programming projects\c++ projects\boost_1_28_0\boost\detail\shared_count.hpp(254) : error C2065: 'Y' : undeclared identifier e:\programming projects\c++ projects\boost_1_28_0\boost\detail\shared_count.hpp(390) : fatal error C1506: unrecoverable block scoping error So I'm not sure if I'm doing something wrong (like not setting up the include order correctly) or if Microsoft is once again making my life hell. I am being bad and using the __int64 data type but I may need to rethink it and convert it to standard C++ (well sorta standard, I think gcc supports a longlong to get a 64bit int.. if not I may change it around to a bit_vector or something). But if anyone can shed some light on why I'm getting these errors listed above I'd really appreciate it. thanks. Joshua.
I'm just trying to include the files for the shared_ptr class and keep having problems. I was able to fix a problem with a duplicate definition of 'max' and 'min' (in suffix.hpp, it was conflicting with a file from the SGI STL implementation) I mainly just commented it out, if someone has a better
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
From: "Joshua"
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
projects\boost_1_28_0\boost\detail\shared_count.hpp(206) : see reference to class template instantiation 'detail::counted_base_impl
' being compiled projects\boost_1_28_0\boost\detail\shared_count.hpp(253) : error C2061: syntax error : identifier 'Y' projects\boost_1_28_0\boost\detail\shared_count.hpp(254) : error C2065: 'Y' : undeclared identifier projects\boost_1_28_0\boost\detail\shared_count.hpp(390) : fatal error C1506: unrecoverable block scoping error Looks like the SGI STL has the "helpful" #define typename somewhere. Fix this (MSVC usually doesn't need this hack) or change all "typename T" template parameters to "class T".
--- In Boost-Users@y..., "Peter Dimov"
I'm just trying to include the files for the shared_ptr class and keep having problems. I was able to fix a problem with a duplicate definition of 'max' and 'min' (in suffix.hpp, it was conflicting with a file from the SGI STL implementation) I mainly just commented it out, if someone has a better
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
From: "Joshua"
plan on how to fix it I would love to know how to fix it. I have tried Boost 1.28 and 1.29 and still got the same set of errors. In addition to the 'max' and 'min' conflict I am getting these errors : projects\boost_1_28_0\boost\checked_delete.hpp(24) : error C2061: syntax error : identifier 'T' projects\boost_1_28_0\boost\checked_delete.hpp(24) : error C2061: syntax error : identifier 'T' projects\boost_1_28_0\boost\checked_delete.hpp(30) : error C2061: syntax error : identifier 'T' projects\boost_1_28_0\boost\checked_delete.hpp(30) : error C2061: syntax error : identifier 'T' projects\boost_1_28_0\boost\detail\shared_count.hpp(184) : error C2504: 'counted_base' : base class undefined e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
e:\programming projects\c++
projects\boost_1_28_0\boost\detail\shared_count.hpp(206) : see reference to class template instantiation 'detail::counted_base_impl
' being compiled projects\boost_1_28_0\boost\detail\shared_count.hpp(253) : error C2061: syntax error : identifier 'Y' projects\boost_1_28_0\boost\detail\shared_count.hpp(254) : error C2065: 'Y' : undeclared identifier projects\boost_1_28_0\boost\detail\shared_count.hpp(390) : fatal error C1506: unrecoverable block scoping error
Looks like the SGI STL has the "helpful"
#define typename
somewhere. Fix this (MSVC usually doesn't need this hack) or change all "typename T" template parameters to "class T".
I was wondering if that would fix the problem, it only seems to be in those 2 locations (that I've found so far). I fixed the Min/Max redefinition problem so I'll do a global replace of typename T to class T when I get back home. The only thing I wonder about is that 'typename' appears to be a reserved word in VC++ (its highlighted blue) so is a direct replacement of 'typename' with 'class' appropriate? I haven't done much indepth template programming experience but spending 5 minutes on google I got this : (exerpt from http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx) "Now the compiler knows T::Bletch is a type, not a member name. You can also use <typename T> instead of <class T> in the template definition. The following statements are identical: template<class X>... template<typename X>... This should answer the question." So, yes, that did answer my question :) Isn't the internet grand :) Thanks I'll let you guys know how it goes when I get home (don't have VC++ at work). Joshua.
Well after one of my buddies at work fiddled around with it in C++ we finally figured out that you can't use the SGI STL by itself since it has problems playing nice with VC++, it was then that we discovered that STLPort IS essentially the SGI STL except that it works. So we installed STLPort and Boost and surprise surprise, its happy and seems to be working now (only instantiated a vector or shared pointers but that compiled and ran). So now I have the wonderful shared pointer and my happy hash sets (barring any problems trying to reimplement it at home). Thanks for pointing me in the right direction :) Joshua.
participants (2)
-
Joshua
-
Peter Dimov