Possible bug in boost_1_28
This bug comes up when I try to include
"Christopher Henrich"
This bug comes up when I try to include
in certain CodeWarrior projects. ... Error: undefined identifier 'ptrdiff_t' ...
I get this too when using Code Warrior for PlayStation2 with
"Christopher Henrich"
wrote: This bug comes up when I try to include
in certain CodeWarrior projects. ... Error: undefined identifier 'ptrdiff_t' ... I get this too when using Code Warrior for PlayStation2 with
. It appears that the compiler-supplied <cstddef> simply contains #include
, so ptrdiff_t is not getting defined in the std namespace. Doing this: namespace std{using ::ptrdiff_t;} #include
fixes it, but I'm not sure that this is strictly allowed.
If anybody knows a better fix, please let me know.
Martin.
Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
I've been wondering how they got around this problem in MSVC6 since it doesn't place any of the ``C'' symbols in std::. If you look closely in the config directory there is a config directive called BOOST_NO_STDC_NAMESPACE that fixes this problem with that exact solution. Well something *really* close: #ifdef BOOST_NO_STDC_NAMESPACE # include <cstddef> namespace std { using ::ptrdiff_t; using ::size_t; } #endif That is from boost/config/suffix.hpp. I think that I have v 1.28.0 but I moved it to c:\boost so that I can upgrade w/o changing all of my include paths. Anyway, to make a long story short, you probably want to add BOOST_NO_STDC_NAMESPACE to either user.hpp or modify boost/config/compiler/metrowerks.hpp to correctly set it based on whatever compiler defines are in effect. - Dave
on 10/9/02 9:00 AM, Martin Stone at yg-boost-users@gmane.org wrote:
I get this too when using Code Warrior for PlayStation2 with
. It appears that the compiler-supplied <cstddef> simply contains #include
, so ptrdiff_t is not getting defined in the std namespace. Doing this: namespace std{using ::ptrdiff_t;} #include
fixes it, but I'm not sure that this is strictly allowed.
If anybody knows a better fix, please let me know.
Martin, Are you sure you know which files are being included from where? One problem I have notices with using Boost and Metrowerks is that since Boost includes headers files with the same name as the standard header files if you are not careful with the paths then the files from Boost are included and not Metrowerks'. What I do is setup my System Paths so that MSL is searched first and then Boost. You might try viewing the preprocessed output of the source file you're compiling and see what is being included from where. Chris
Chris Little
on 10/9/02 9:00 AM, Martin Stone at yg-boost-users@gmane.org wrote:
I get this too when using Code Warrior for PlayStation2 with
. It appears that the compiler-supplied <cstddef> simply contains #include
, so ptrdiff_t is not getting defined in the std namespace. Doing this: namespace std{using ::ptrdiff_t;} #include
fixes it, but I'm not sure that this is strictly allowed.
If anybody knows a better fix, please let me know.
Martin,
Are you sure you know which files are being included from where?
One problem I have notices with using Boost and Metrowerks is that since Boost includes headers files with the same name as the standard header files if you are not careful with the paths then the files from Boost are included and not Metrowerks'.
What I do is setup my System Paths so that MSL is searched first and then Boost.
I think that's a mistake, Chris. The only place Boost includes headers with the same names as standard ones is in the compatibility library. If we are replacing any standard headers, it's intentional. I think the reason you have trouble with CW is their crazy convention of automatically enabling *recursive* search through any of the #include paths you specify. IMO you should turn that off and specify each directory explicitly, so you know what you're getting. -- David Abrahams * Boost Consulting dave@boost-consulting.com * http://www.boost-consulting.com
on 10/10/02 1:26 PM, David Abrahams at dave@boost-consulting.com wrote:
I think that's a mistake, Chris. The only place Boost includes headers with the same names as standard ones is in the compatibility library. If we are replacing any standard headers, it's intentional. I think the reason you have trouble with CW is their crazy convention of automatically enabling *recursive* search through any of the #include paths you specify. IMO you should turn that off and specify each directory explicitly, so you know what you're getting.
Isn't it strange how you can get tunnel vision about the solutions to problems. We have so many projects that rely on the recursive search that I forget that it doesn't exist in other tools and boost doesn't rely on it. I agree that a better solution for Martin is to make sure that the recursive search of the boost directory is turned off and see if this helps. Chris
This bug comes up when I try to include
in certain CodeWarrior projects. ... Error: undefined identifier 'ptrdiff_t' ... I get this too when using Code Warrior for PlayStation2 with
. It appears that the compiler-supplied <cstddef> simply contains #include
, so ptrdiff_t is not getting defined in the std namespace. Doing this: namespace std{using ::ptrdiff_t;} #include
fixes it, but I'm not sure that this is strictly allowed.
If anybody knows a better fix, please let me know.
Maybe we need to define BOOST_NO_STDC_NAMESPACE for that combination? John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
participants (6)
-
Chris Little
-
Christopher Henrich
-
Dave Shawley
-
David Abrahams
-
John Maddock
-
Martin Stone