You are not logged in.
Pages: 1
I am trying to compile openvrml which uses the boost library. I get the following error:
/usr/include/boost/numeric/conversion/detail/converter.hpp:233: error: expected unqualified-id before numeric constant
/usr/include/boost/numeric/conversion/detail/converter.hpp:238: error: type/value mismatch at argument 6 in template parameter list for 'template<class expr0, class expr1, class TT, class TF, class FT, class FF> struct boost::numeric::convdetail::for_both'
/usr/include/boost/numeric/conversion/detail/converter.hpp:238: error: expected a type, got '0l'
/usr/include/boost/numeric/conversion/detail/converter.hpp:238: error: 'type' does not name a type
The code in question is :
template<class PredA, class PredB>
struct combine
{
typedef applyBoth<PredA,PredB> Both ;
typedef void None ; //line number 233
typedef typename PredA::do_apply do_applyA ;
typedef typename PredB::do_apply do_applyB ;
typedef typename for_both<do_applyA, do_applyB, Both, PredA, PredB, None>::type type ; //line number 238
} ;
Anyone knows what these error means or how to get rid of them?
Offline
Well, I know the error on line 238 is caused because the typedef void None is failing on line 233. Not sure how to fix line 233 though...
Offline
I didn't mentionned it in my first post but commenting out line 233 and replacing 'None' by 'void' in line 238 solved the compilation problem. Since it is based on only an educated guess, I have no idea if it's a valid (or the best?) solution. :?
Offline
"None" is already defined in Xlib.h - that's probably where the error is coming from.
Offline
"None" is already defined in Xlib.h - that's probably where the error is coming from.
Doesn't seem to be the case:
$ grep None /usr/X11R6/include/X11/Xlib.h
Pixmap background_pixmap; /* background or None or ParentRelative */
Cursor cursor; /* cursor to be displayed (or None) */
* NotifyPointerRoot, NotifyDetailNone
Atom property; /* ATOM or None */
Colormap colormap; /* COLORMAP or None */
Font font; /* font to print it in, None don't change */
Font font; /* font to print it in, None don't change */
#define XIMPreeditNone 0x0010L
#define XIMStatusNone 0x0800L
#define XLookupNone 1
Offline
I don't understand why you are typdefing a keyword directly. Why not just use void? Maybe I'm missing something.
Offline
I don't understand why you are typdefing a keyword directly. Why not just use void? Maybe I'm missing something.
That's because I didn't wrote the code I posted. It comes from /usr/include/boost/numeric/conversion/detail/converter.hpp wich is part of the boost library. I don't know C++. I basically want to know if there is a problem with that code snippet before reporting that as a bug on the boost ML. :?
Offline
Well, I think it's safe to say it's a bug, because None clearly must be defined somewhere else. It expected an "unqualified-id," or something not all ready defined. I think then you should also bring up in the ML that typedef-ing a single keyword to something else is truly a waste of time, effort and thought IMHO :-P.
Offline
It's in X.h
$ grep " None " /usr/X11R6/include/X11/X.h
#define None 0L /* universal null resource or null atom */
Offline
Yeah Cerebral got it - when I said it's defined in Xlib.h, I kinda meant "Xlib.h and any of the 5 jillion headers it pulls in with it"
So here's what happens:
#define None 0L
...
typedef void None;
becomes:
typedef void 0L; //ACK! FAIL!
Offline
Thanks everyone! I'll report that on the boost ML.
Offline
Pages: 1