I've developed my library with MSVC7 and am now trying to test on as many compiler as possible. Using g++ 2.95.3-5 on cywin, I get a compiler error using std::distance `distance' undeclared in namespace `std' I have tried all the obvious includes, but the problem seems to be a configuration issue for using namespaces. The code compiles on VC7/Dinkumware, VC7/STLport-4.5.3 and BCC 5.5.1 so I am confident that there is no error in the code itself. Could someone please point me in the right direction? TIA -- Craig
At 06:00 PM 9/20/2002, Craig Henderson wrote:
I've developed my library with MSVC7 and am now trying to test on as many compiler as possible. Using g++ 2.95.3-5 on cywin, I get a compiler error using std::distance
`distance' undeclared in namespace `std'
I have tried all the obvious includes, but the problem seems to be a configuration issue for using namespaces. The code compiles on VC7/Dinkumware, VC7/STLport-4.5.3 and BCC 5.5.1 so I am confident that there is no error in the code itself.
At this point in time g++ 2.95.3-5 is quite a few (six maybe?) releases and a year and a half behind the current release (3.2). GCC and its libraries have made major steps forward during that time. Maybe you should consider downloading 3.2 instead of putting effort into 2.95.3. You will have to compile it yourself, but just following the instructions has worked fine for me (but do run the configure, make, and install steps under cygwin.) --Beman
"Beman Dawes"
At this point in time g++ 2.95.3-5 is quite a few (six maybe?) releases and a year and a half behind the current release (3.2). GCC and its libraries have made major steps forward during that time. Maybe you should consider downloading 3.2 instead of putting effort into 2.95.3. You will have to compile it yourself, but just following the instructions has worked fine for me (but do run the configure, make, and install steps under cygwin.)
Wait! You can't "just follow the directions", unfortunately. When you run the configure step, you MUST add --prefix="..." to avoid collisions with your existing g++ installation. For example: ./configure --prefix=/usr/local/gcc-3.2 make bootstrap ; make install # Wait a few hours... -- ----------------------------------------------------------- David Abrahams * Boost Consulting dave@boost-consulting.com * http://www.boost-consulting.com
At 10:41 PM 9/22/2002, David Abrahams wrote:
"Beman Dawes"
wrote in message news:4.3.2.7.2.20020922194954.02398c78@mailhost.esva.net... At this point in time g++ 2.95.3-5 is quite a few (six maybe?) releases and a year and a half behind the current release (3.2). GCC and its
libraries
have made major steps forward during that time. Maybe you should consider downloading 3.2 instead of putting effort into 2.95.3. You will have to compile it yourself, but just following the instructions has worked fine for me (but do run the configure, make, and install steps under cygwin.)
Wait!
You can't "just follow the directions", unfortunately.
When you run the configure step, you MUST add --prefix="..." to avoid collisions with your existing g++ installation. For example:
./configure --prefix=/usr/local/gcc-3.2 make bootstrap ; make install # Wait a few hours...
I never give configure any arguments. Works fine for me. Although it does put libraries at the wrong place in the directory tree, and I have to move them. --Beman
I've developed my library with MSVC7 and am now trying to test on as many compiler as possible. Using g++ 2.95.3-5 on cywin, I get a compiler error using std::distance
`distance' undeclared in namespace `std'
I have tried all the obvious includes, but the problem seems to be a configuration issue for using namespaces. The code compiles on VC7/Dinkumware, VC7/STLport-4.5.3 and BCC 5.5.1 so I am confident that there is no error in the code itself.
Could someone please point me in the right direction?
Almost certainly a missing: #include <iterator> Apologies if you've tried that already... cygwin definitely has a std::distance though... John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
"John Maddock"
I've developed my library with MSVC7 and am now trying to test on as many compiler as possible. Using g++ 2.95.3-5 on cywin, I get a compiler error using std::distance
`distance' undeclared in namespace `std'
I have tried all the obvious includes, but the problem seems to be a configuration issue for using namespaces. The code compiles on VC7/Dinkumware, VC7/STLport-4.5.3 and BCC 5.5.1 so I am confident that there is no error in the code itself.
Could someone please point me in the right direction?
Almost certainly a missing:
#include <iterator>
Thanks John. Unfortunately, this doesn't makes any difference. I'm really stumped by this, it must be something simple! I think I'll have to request the aid of g++/cygwin gurus once my code makes it into the sandbox. It's strange that 3 compiler/STL combinations work, yet g++ just gives up :-(
Apologies if you've tried that already... cygwin definitely has a std::distance though...
John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
participants (4)
-
Beman Dawes
-
Craig Henderson
-
David Abrahams
-
John Maddock