Reputation: 351
I have downloaded jsvm software, and I am getting many errors while compiling. Few of them is as follows.
/usr/include/c++/4.3/bits/algorithmfwd.h:248:41: error: macro "max" passed 3 arguments, but takes just 2
And the file algorithmfwd.h is as follows
template<typename _Tp>
const _Tp&
min(const _Tp&, const _Tp&);
template<typename _Tp, typename _Compare>
const _Tp&
min(const _Tp&, const _Tp&, _Compare);
// min_element
Upvotes: 2
Views: 2143
Reputation: 153919
Somewhere, you have defined a macro max
, which is not allowed if you
include any headers from the standard library (which has a set of
overloaded functions named max
). You'll have to find out where this
macro is defined, and get rid of it. Two immediate possibilities come
to mind:
/DNOMINMAX
to
your compiler options to suppress this.
#undef min #undef maxUse these wrappers instead of the library headers you were given (and pressure the library provider to correct this).
Upvotes: 2
Reputation: 39164
You are not showing the max macro. Anyway seems that you are trying to use a macro with one more parameter than what it is expecting.
I am getting many errors while compiling
Try to solve your errors in order, because one mistake can influence the next.
Upvotes: 0
Reputation: 208353
The error is quite explicit:
/usr/include/c++/4.3/bits/algorithmfwd.h:248:41: error: macro "max" passed 3 arguments, but takes just 2
Before inclusion of that particular header, you have defined a macro max
that takes 3 arguments. Macros are evil in that they are applied everywhere that the identifier appears. Review where in the code you are defining that macro and remove it, or at the very least change it into upper case (common convention for macros) so that it does not get expanded in all other headers.
Upvotes: 3
Reputation: 26094
It appears as, in addition to the functions in algorithmfwd.h
have a preprocessor-style macro also named max
. Try to find whoever is defining this and avoid include that header files, or use #undef max
if all else fail.
Upvotes: 0