Re: [Hapy-users] Msvc compilation errors
Status: Beta
Brought to you by:
rousskov
|
From: Alex R. <rou...@me...> - 2004-09-08 15:37:53
|
Srinidhi, I am not sure what causes the errors you quoted. It seems to be related to the Hapy use of the std_bidirectional_iterator template. It is not the first time that supposed-to-be-portable STL construct causes compilation troubles. Perhaps my code in PreeKids.h uses std_bidirectional_iterator interface the wrong way. Attached is a patch that might help. It changes std::iterator_traits<PreeKidsIterator> in typedefs to more explicit std::iterator_traits< PreeKidsIterator<Base> > The patch does not cause compilation problems with GCC 2.95. I do not have access to MSVC. Please let me know whether the patch helps in your case. I doubt the patch helps, but it does not hurt to try. FWIW, there are many Hapy users building Hapy with MS compilers. I wonder if there is some MSVC version compatibility issue here? What version do you use? If anybody has better std_bidirectional_iterator knowledge or workaround suggestions please chime in! Thank you, Alex. -- Protocol performance, functionality, and reliability testing. Tools, services, and know-how. http://www.measurement-factory.com/ On Wed, 8 Sep 2004, srinidhi wrote: > Hi > I am trying to build the hapy parser library under MSVC windows. > I am getting the following errors: > Compiling... > Algorithm.cpp > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(98 > ) : error C2027: use of undefined type 'PreeKidsIterator<class Hapy::Pree>' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(98 > ) : error C2146: syntax error : missing ';' before identifier > 'iterator_category' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(98 > ) : error C2868: 'iterator_category' : illegal syntax for using-declaration; > expected qualified-name > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(99 > ) : error C2027: use of undefined type 'PreeKidsIterator<class Hapy::Pree>' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(99 > ) : error C2146: syntax error : missing ';' before identifier 'value_type' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(99 > ) : error C2868: 'value_type' : illegal syntax for using-declaration; > expected qualified-name > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 0) : error C2027: use of undefined type 'PreeKidsIterator<class Hapy::Pree>' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 0) : error C2146: syntax error : missing ';' before identifier > 'difference_type' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 0) : error C2868: 'difference_type' : illegal syntax for using-declaration; > expected qualified-name > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 1) : error C2027: use of undefined type 'PreeKidsIterator<class Hapy::Pree>' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 1) : error C2146: syntax error : missing ';' before identifier 'pointer' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 1) : error C2868: 'pointer' : illegal syntax for using-declaration; expected > qualified-name > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 2) : error C2027: use of undefined type 'PreeKidsIterator<class Hapy::Pree>' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 2) : error C2146: syntax error : missing ';' before identifier 'reference' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > c:\mmp3\master\base\external\c\stlport-4.6.2\stlport\stl\_iterator_base.h(10 > 2) : error C2868: 'reference' : illegal syntax for using-declaration; > expected qualified-name > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(17) : see > reference to class template instantiation '_STL::iterator_traits<class > Hapy::PreeKidsIterator<class Hapy::Pree> >' being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\preekids.h(32) : warning C4284: > return type for 'Hapy::PreeKidsIterator<class Hapy::Pree>::operator ->' is > 'int' (ie; not a UDT or reference to a UDT. Will produce errors if applied > using infix notation) > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(113) : see reference > to class template instantiation 'Hapy::PreeKidsIterator<class Hapy::Pree>' > being compiled > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(114) : error C2839: invalid > return type 'int' for overloaded 'operator ->' > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(114) : error C2227: left of > '->rid' must point to class/struct/union > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(115) : error C2102: '&' > requires l-value > d:\ozone3\hapy\hapy-0.0.6\src\include\hapy\pree.h(116) : error C2664: > 'find_first' : cannot convert parameter 1 from 'int' to 'const class > Hapy::Pree &' > Reason: cannot convert from 'int' to 'const class Hapy::Pree' > No constructor could take the source type, or constructor overload > resolution was ambiguous > Error executing cl.exe. > > What is the fix for this?? > regards > Srinidhi > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Hapy-users mailing list > Hap...@li... > https://lists.sourceforge.net/lists/listinfo/hapy-users > |