Re: [Boost-users] [Preprocessor] Relative Addresses in BOOST_PP_FILENAME_1

Dear TONGARI,
Where I said <> I meant <something in compiler's include path>, that works fine, just as Edward and Steven said.
Well, my working directory is already in my compiler's include path. And, inside Header.hpp, the following line #define BOOST_PP_FILENAME1 <Header.hpp> fails to compiler in GCC 4.5.1 because GCC says it can't find Header.hpp. And, I am missing anything here? Maybe it's better that you tell me what you'd be writing instead of the line above if it would have been you...
If this is not a bug with a specific compiler, I hope at least it should be noted in Boost.PP's doc.
It's not. Both quote and angle brackets are mentioned to work in the specs: http://www.boost.org/doc/libs/1_45_0/libs/preprocessor/doc/ref/filename_x.ht... TIA, --Hossein

On 1/24/2011 1:49 PM, Hossein Haeri wrote:
Dear TONGARI,
Where I said<> I meant<something in compiler's include path>, that works fine, just as Edward and Steven said.
Well, my working directory is already in my compiler's include path. And, inside Header.hpp, the following line
#define BOOST_PP_FILENAME1<Header.hpp>
This should be: #define BOOST_PP_FILENAME_1 <header.hpp>
fails to compiler in GCC 4.5.1 because GCC says it can't find Header.hpp. And, I am missing anything here? Maybe it's better that you tell me what you'd be writing instead of the line above if it would have been you...
So you are saying that if in your own files you have: #include <header.hpp> that gcc 4.5.1 finds it but if you have: #define BOOST_PP_FILENAME_1 <header.hpp> that gcc 4.5.1 does not find it ? That really is odd.
If this is not a bug with a specific compiler, I hope at least it should be noted in Boost.PP's doc.
It's not. Both quote and angle brackets are mentioned to work in the specs:
http://www.boost.org/doc/libs/1_45_0/libs/preprocessor/doc/ref/filename_x.ht...
I agree it should be noted in the Boost PP docs that quote brackets may fail. But it is not that the quote brackets always do not work since the rules for how a compiler searches for header files within quote brackets is compiler dependent. As noted VC++ works with quoted brackets because its search rules are much more extended than gcc.

Hi Edward,
#define BOOST_PP_FILENAME1<Header.hpp>
This should be:
#define BOOST_PP_FILENAME_1 <header.hpp>
This doesn't work either.
So you are saying that if in your own files you have:
#include <header.hpp>
that gcc 4.5.1 finds it...
Yup.
... but if you have:
#define BOOST_PP_FILENAME_1 <header.hpp>
(in Header.hpp itself)
that gcc 4.5.1 does not find it ?
Correct. I even renamed Header.hpp to header.hpp (all-lower-case) and GCC still can't find it. The error message can be found in the P.S. where line 52 of forward1.hpp is: # include BOOST_PP_FILENAME_1 Any idea? TIA, --Hossein P.S. Compiling: main.cpp In file included from D:\My Documents\My Programmes\Tutorial\Boost\PP\CabBeCalled3\header.hpp:48:0, from D:\My Documents\My Programmes\Tutorial\Boost\PP\CabBeCalled3\main.cpp:3: D:\Sources\Boost\boost_1_42_0/boost/preprocessor/iteration/detail/iter/forward1.hpp:52:37: fatal error: header.hpp: No such file or directory compilation terminated.

2011/1/25 Hossein Haeri <powerprogman@yahoo.com>
Dear TONGARI,
Where I said <> I meant <something in compiler's include path>, that works fine, just as Edward and Steven said.
Well, my working directory is already in my compiler's include path. And, inside Header.hpp, the following line
#define BOOST_PP_FILENAME1 <Header.hpp>
Shouldn't it be #define BOOST_PP_FILENAME_1 <Header.hpp> ? Maybe it's better that you tell me what you'd be writing instead of the line
above if it would have been you...
For example, suppose I have a lib called "Lib" that contains a header called "A.hpp" which includes "A_n_iteration.hpp" placed in the "detail" folder, I usually do: /* in A.hpp */ #include <Lib/detail/A_n_iteration.hpp> /* in A_n_iteration.hpp */ #if !BOOST_PP_IS_ITERATING #define BOOST_PP_ITERATION_LIMITS (0, SOME_LIMIT) /***/ #define BOOST_PP_FILENAME_1 <Lib/detail/A_n_iteration.hpp> /***/ #include BOOST_PP_ITERATE() #else // iterating // THE CODE TO ITERATE.... #endif That's all. Just make sure "Lib" is in the include path, then everything works fine for me.
If this is not a bug with a specific compiler, I hope at least it should
be noted in Boost.PP's doc.
It's not. Both quote and angle brackets are mentioned to work in the specs:
http://www.boost.org/doc/libs/1_45_0/libs/preprocessor/doc/ref/filename_x.ht...
It would be fine in the Remarks section to add words like: "quoted filename may not work with some compilers here, such as gcc..."
participants (3)
-
Edward Diener
-
Hossein Haeri
-
TONGARI