|
I have encountered a problem with the
DAT 2.0 header files from OFED 1.2 on SLES 10 when using the GNU C++ compiler.
The following "program" compiles
as a C program:
1: #include "/usr/local/include/dat/udat.h"
2: int main()
3: {}
If I change the file type to .cpp and
compile it, I get the following:
gcc test1.cpp
/usr/local/include/dat/dat.h:288: error:
use of enum dat_lmr_param_mask without previous declaration
/usr/local/include/dat/dat.h:288: error:
invalid type in declaration before ; token
The compiler is complaining about a
reference to an undefined enum (dat_lmr_param_mask) at line 288 of dat.h.
The enum is defined at line 218 of udat.h. Unfortunately, line 120 of udat.h
includes dat.h. So the compiler sees the reference at line 288 of dat.h
before it sees the definition at line 218 of udat.h.
A fix is modify udat.h by moving the
dat_lmr_param_mask enum definition to some place before the "#include
<dat/dat.h>" line. See the attached udat.h for a "fixed"
version.
thanks.
|