andrew
08-28-2004, 06:17 AM
Hi,
I have recently purchased the NRC++ book and downloaded the code for Liinux (running Suse 9.1 with gcc version 3.3.3-41)
I tring to create the object file using the make command as detailed in the documentation. I changed the CC to a cc and tried gcc but I get the following errors:
------------------------
cc -I/usr/local/src/recipes_cpp/utils -I. -o xairy.out xairy.o airy.o bessik.o bessjy.o beschb.o chebev.o -lm
xairy.o(.text+0x1c): In function `main':
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string[in-charge]()'
xairy.o(.text+0x35): In function `main':
: undefined reference to `std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream[in-charge](char const*,
------------ and a lot more!
I also run into errors tring to include the code directly into any programs a write. I include the nr.h header into my program and this works fine, but I can't seem to access the routines by calling them directly. For example the following code from the example on page 2 of the book fails:
for(i=0 ;i<NTOT ;i++ ){
flmoon(i,nph,jd,frac);
}
with the message:
/hi.cpp:36: error: `flmoon' undeclared (first use this function)
If any one can help I would truly appreciate it.
Andrew:confused:
I have recently purchased the NRC++ book and downloaded the code for Liinux (running Suse 9.1 with gcc version 3.3.3-41)
I tring to create the object file using the make command as detailed in the documentation. I changed the CC to a cc and tried gcc but I get the following errors:
------------------------
cc -I/usr/local/src/recipes_cpp/utils -I. -o xairy.out xairy.o airy.o bessik.o bessjy.o beschb.o chebev.o -lm
xairy.o(.text+0x1c): In function `main':
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string[in-charge]()'
xairy.o(.text+0x35): In function `main':
: undefined reference to `std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream[in-charge](char const*,
------------ and a lot more!
I also run into errors tring to include the code directly into any programs a write. I include the nr.h header into my program and this works fine, but I can't seem to access the routines by calling them directly. For example the following code from the example on page 2 of the book fails:
for(i=0 ;i<NTOT ;i++ ){
flmoon(i,nph,jd,frac);
}
with the message:
/hi.cpp:36: error: `flmoon' undeclared (first use this function)
If any one can help I would truly appreciate it.
Andrew:confused: