where to include nr.h?


mvanstraten
02-24-2003, 05:37 AM
Hello all,

I am using nr in c++ with Qt and VTK on Microsoft VC6.0. I have some problems with including nr.h. When I include nr.h in a header file (.h) i get the following errors:

g:\cpp210\cpp\other\nrutil_nr.h(16) : error C2059: syntax error : 'function-style cast'
g:\cpp210\cpp\other\nrutil_nr.h(16) : error C2226: syntax error : unexpected type 'T'
g:\cpp210\cpp\other\nrutil_nr.h(16) : error C2059: syntax error : ')'
g:\cpp210\cpp\other\nrutil_nr.h(19) : error C2062: type 'const double' unexpected
g:\cpp210\cpp\other\nrutil_nr.h(19) : error C2059: syntax error : ')'
g:\cpp210\cpp\other\nrutil_nr.h(20) : error C2143: syntax error : missing ';' before '{'
g:\cpp210\cpp\other\nrutil_nr.h(20) : error C2447: missing function header (old-style formal list?)
g:\cpp210\cpp\other\nrutil_nr.h(22) : error C2062: type 'const float' unexpected
g:\cpp210\cpp\other\nrutil_nr.h(22) : error C2062: type 'const float' unexpected
g:\cpp210\cpp\other\nrutil_nr.h(22) : error C2059: syntax error : ')'
g:\cpp210\cpp\other\nrutil_nr.h(23) : error C2143: syntax error : missing ';' before '{'
g:\cpp210\cpp\other\nrutil_nr.h(23) : error C2447: missing function header (old-style formal list?)
g:\cpp210\cpp\other\nrutil_nr.h(25) : error C2954: template definitions cannot nest
g:\cpp210\cpp\other\nrutil_nr.h(26) : error C2059: syntax error : 'function-style cast'
g:\cpp210\cpp\other\nrutil_nr.h(26) : error C2226: syntax error : unexpected type 'T'
g:\cpp210\cpp\other\nrutil_nr.h(26) : error C2059: syntax error : ')'
g:\cpp210\cpp\other\nrutil_nr.h(29) : error C2062: type 'const float' unexpected
g:\cpp210\cpp\other\nrutil_nr.h(29) : error C2059: syntax error : ')'
g:\cpp210\cpp\other\nrutil_nr.h(30) : error C2143: syntax error : missing ';' before '{'
g:\cpp210\cpp\other\nrutil_nr.h(30) : error C2447: missing function header (old-style formal list?)
g:\cpp210\cpp\other\nrutil_nr.h(32) : error C2062: type 'const float' unexpected
g:\cpp210\cpp\other\nrutil_nr.h(32) : error C2062: type 'const double' unexpected
g:\cpp210\cpp\other\nrutil_nr.h(32) : error C2059: syntax error : ')'
g:\cpp210\cpp\other\nrutil_nr.h(33) : error C2143: syntax error : missing ';' before '{'
g:\cpp210\cpp\other\nrutil_nr.h(33) : error C2447: missing function header (old-style formal list?)
g:\cpp210\cpp\other\nrutil_nr.h(35) : error C2954: template definitions cannot nest

When I include nr.h in the corresponding .cpp file, the errors disappear and everything seems to work fine. However, I can not use things from NR in the header file then.

Who knows why I get these errors?

Thanks in advance,

Marcel van Straten
Amsterdam, The Netherlands.