Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Obsolete Editions Forum > C++ Programming with NR

Reply
 
Thread Tools Display Modes
  #1  
Old 02-24-2003, 05:37 AM
mvanstraten mvanstraten is offline
Member
 
Join Date: Feb 2003
Posts: 1
Question where to include nr.h?

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:01 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.