![]() |
Blitz Support : |
From: Breeveld, Eddie \(Reigate\) (Eddie.Breeveld_at_[hidden])
Date: 2005-06-02 03:43:23
FYI: There is a similar problem with ATL/MFC on Windows. The solution is
to add the line
#define NOMINMAX
before including any Blitz/Windows headers.
All the best,
Eddie
____________________
Edward Breeveld
eSolutions
Watson Wyatt LLP
Watson House, London Road,
Reigate, Surrey, RH2 9PQ, UK
Tel. +44 (0)1737 274151
Fax. +44 (0)1737 241496
www.watsonwyatt.com
-----Original Message-----
From: blitz-support-bounces_at_[hidden]
[mailto:blitz-support-bounces_at_[hidden]] On Behalf Of Lukasz Dobrek
Sent: 02 June 2005 09:29
To: Julian Cummings
Cc: Support list for Blitz++
Subject: Re: [Blitz-support] blitz + boost problems
Hi Julian,
Thank you for your answer. I managed to solve it by myself, but
anyway thank you.
I agree with you that it is a dangerous practice to leave this to macros
underfined on the other hand blitz could go around this problem by
bracketing each min and max. I.e. instead of writing
template<P>
P min( Vector<P> const & a ){ ... }
write:
template<P>
P (min)( Vector<P> const & a ){ ... }
I cannot honestly say that I think it is a good solution. The good
solution is probably to convince boost people to undef min and max. But
it is also a solution, it makes
blitz beinng less (other parties) errors prone.
On 6/1/05, Julian Cummings <cummings_at_[hidden]> wrote:
> Hello Lukasz,
>
> Apparently boost is defining a macro called "min" that is interfering
> with blitz when it attempts to define a function called "min" in
> <blitz/vecmin.cc>. Defining macros with very generic names like "min"
> in header files and then leaving them defined in user code is a *very*
> bad idea.
>
> A simple workaround would be to undefine "min" somewhere near the
> start of
> <blitz/vecmin.cc>:
>
> #ifdef min
> #undef min
> #endif
>
> The only problem with this is that if for some crazy reason boost
> really needs this macro sometime later on in the code, it will be
> gone. You might want to search in the boost headers to determine
> where the macro min is defined and used. The proper solution is for
> the boost headers to undefine the min macro when it is no longer
> needed, so that it does not pollute other code like this.
> Incidentally, you may discover a similar problem with "max" and the
> header file <blitz/vecmax.cc>, since min and max usually occur
> together.
>
> Regards, Julian C.
>
> Dr. Julian C. Cummings
> Staff Scientist, CACR/Caltech
> (626) 395-2543
> cummings_at_[hidden]
>
>
> > -----Original Message-----
> > From: blitz-support-bounces_at_[hidden]
> > [mailto:blitz-support-bounces_at_[hidden]] On Behalf Of Lukasz
> > Dobrek
> > Sent: Thursday, May 26, 2005 6:40 AM
> > To: blitz-support_at_[hidden]
> > Subject: [Blitz-support] blitz + boost problems
> >
> > Hi
> > I have a problem with using in the same project blitz-0.8 and
> > boost-1.32, I use VS .NET environment. I didn't test it with other
> > compilers, so I don't know whether it is reproducable in different
> > setings, but:
> >
> > this works:
> >
> > #include <blitz/array.h>
> > #include <boost/date_time/posix_time/posix_time.hpp>
> > void test()
> > {
> >
> > }
> > while this:
> >
> > #include <boost/date_time/posix_time/posix_time.hpp>
> > #include <blitz/array.h>
> > void test()
> > {
> > }
> >
> > does not. It failes with plenty of syntax errors:
> >
> > c:\ALM_Hybrid\blitz\blitz\vecmin.cc(59) : warning C4003: not enough
> > actual parameters for macro 'min'
> > c:\ALM_Hybrid\blitz\blitz\vecmin.cc(59) : error C2226: syntax error
> > : unexpected type 'blitz::Vector<P_numtype>'
> > c:\ALM_Hybrid\blitz\blitz\vecmin.cc(59) : error C2988:
> > unrecognizable template declaration/definition
> > c:\ALM_Hybrid\blitz\blitz\vecmin.cc(59) : error C2059: syntax error
> > : ')'
> > c:\ALM_Hybrid\blitz\blitz\vecmin.cc(59) : error C2059: syntax error
> > : ')'
> > c:\ALM_Hybrid\blitz\blitz\vecmin.cc(67) : error C2653: 'P_expr' : is
> > not a class or namespace name
> > c:\ALM_Hybrid\blitz\blitz\vecmin.cc(67) : error C2146: syntax error
> > : missing ',' before identifier 'T_numtype'
> > c:\ALM_Hybrid\blitz\blitz\vecmin.cc(67) : error C2065: 'T_numtype' :
> > undeclared identifier
> >
> > and so on and on.
> >
> >
> > I don't know whether it is more blitz or more boost issue, but As
> > the errors appear to come from Blitz I send it first heare.
> >
> > Regrads
> > Lukasz
> >
> > _______________________________________________
> > Blitz-support mailing list
> > Blitz-support_at_[hidden]
> > http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
> >
> >
>
>
>
_______________________________________________
Blitz-support mailing list
Blitz-support_at_[hidden]
http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
_________________________________________________________________
Notice of Confidentiality
This transmission contains information that may be confidential and that may also be privileged. Unless you are the intended recipient of the message (or authorised to receive it for the intended recipient) you may not copy, forward, or otherwise use it, or disclose it or its contents to anyone else. If you have received this transmission in error please notify us immediately and delete it from your system. Please contact the sender if you have any problems with this email.
In the UK, Watson Wyatt LLP is authorised and regulated by the Financial Services Authority. The services of Watson Wyatt in Ireland are provided by Watson Wyatt LLP, a limited liability partnership incorporated under English Law, with the exception of services which are provided as a Multi-Agency Intermediary, which for regulatory purposes, are provided by Watson Wyatt Partners, which is regulated by the Irish Financial Services Regulatory Authority, on behalf of Watson Wyatt LLP.
_________________________________________________________________