[ADOL-C] c++0x compile errors
Brad Atcheson
atcheson at cs.ubc.ca
Mon Dec 12 21:45:26 EST 2011
Hi,
I'm having trouble compiling when the "-std=c++0x" flag is set under
both GCC 4.6.2 and GCC 4.5.1 on SuSE Linux 11.4.
It works fine under clang on OS X, and when I remove all C++11 code it
compiles under gcc on Linux.
But with the flag set on gcc I get these messages (I replaced long
path prefixes with X and Y for clarity):
In file included from Y/include/c++/4.6.2/random:38:0,
from Y/include/c++/4.6.2/bits/stl_algo.h:67,
from Y/include/c++/4.6.2/algorithm:63,
from src/raytrace.cpp:7:
Y/include/c++/4.6.2/cmath: In function 'typename
__gnu_cxx::__promote_2<_Tp, _Up>::__type std::fmin(_Tp, _Up) [with _Tp
= adouble, _Up = int, typename __gnu_cxx::__promote_2<_Tp,
_Up>::__type = adub]':
src/raytrace.cpp:559:30: instantiated from here
Y/include/c++/4.6.2/cmath:1319:43: error: no matching function for
call to 'adub::adub(adouble&)'
Y/include/c++/4.6.2/cmath:1319:43: note: candidates are:
X/include/adolc/adouble.h:268:5: note: adub::adub(double)
X/include/adolc/adouble.h:268:5: note: no known conversion for
argument 1 from 'adouble' to 'double'
X/include/adolc/adouble.h:263:5: note: adub::adub()
X/include/adolc/adouble.h:263:5: note: candidate expects 0
arguments, 1 provided
X/include/adolc/adouble.h:262:5: note: adub::adub(unsigned int)
X/include/adolc/adouble.h:262:5: note: no known conversion for
argument 1 from 'adouble' to 'unsigned int'
X/include/adolc/adouble.h:256:24: note: adub::adub(const adub&)
X/include/adolc/adouble.h:256:24: note: no known conversion for
argument 1 from 'adouble' to 'const adub&'
Y/include/c++/4.6.2/cmath:1319:43: error: call of overloaded
'adub(int&)' is ambiguous
Y/include/c++/4.6.2/cmath:1319:43: note: candidates are:
X/include/adolc/adouble.h:268:5: note: adub::adub(double)
X/include/adolc/adouble.h:262:5: note: adub::adub(unsigned int)
X/include/adolc/adouble.h:256:24: note: adub::adub(const adub&)
Y/include/c++/4.6.2/cmath: In function 'typename
__gnu_cxx::__promote_2<_Tp, _Up>::__type std::fmax(_Tp, _Up) [with _Tp
= adub, _Up = int, typename __gnu_cxx::__promote_2<_Tp, _Up>::__type =
adub]':
src/raytrace.cpp:559:36: instantiated from here
Y/include/c++/4.6.2/cmath:1303:43: error: call of overloaded
'adub(int&)' is ambiguous
Y/include/c++/4.6.2/cmath:1303:43: note: candidates are:
X/include/adolc/adouble.h:268:5: note: adub::adub(double)
X/include/adolc/adouble.h:262:5: note: adub::adub(unsigned int)
X/include/adolc/adouble.h:256:24: note: adub::adub(const adub&)
scons: *** [build/raytrace.o] Error 1
scons: building terminated because of errors.
The fmin and fmax functions appear to be guarded by
#if !defined(_ISOC99_SOURCE) && !defined(__USE_ISOC99) && !defined(__APPLE_CC__)
and by
#if !defined(_ISOC99_SOURCE) && !defined(__USE_ISOC99)
in adouble.h
- brad
More information about the ADOL-C
mailing list