Ashur
01-01-2015, 03:32 PM
I am using cygwin on my windows 7 to learn C++ and write some codes for my physics projects. I also have the NR book and code files to practice the coding and see how they work. However, I have problem compiling those codes under my cygwin OS which is supposed to be a Linux on top of my Windows OS. As long as I was practicing C codes from the book "C Plus Primer," I didn't have problem. What I was doing was that I was saving the source code as "sourcecode.c" in some directory of D:/cygwin64/home/user/nr3 in which there are also all the header files used in the codes under a separate subdirectory ../nr3/code. Then, I created .cpp version of the source code by "vi sourcecode.cpp". Then, I did "make sourcecode" and finally "./sourcecode" to compile the code. In most cases I didn't have problem. However, now that I am trying to do the same with NR3 codes, AFTER creating .cpp file, I am getting error message as follows as I type "make sourcecode" :
__________________
cc rational_function_interpolation.c -o rational_function_interpolation
rational_function_interpolation.c:1:25: fatal error: ../code/nr3.h: No such file or directory
#include <../code/nr3.h>
^
compilation terminated.
<builtin>: recipe for target 'rational_function_interpolation' failed
make: *** [rational_function_interpolation] Error 1
__________________
I have tried to follow all the suggestions in some posts of nr.com/forum but it seems that none is working for me. I think maybe cygwin is not capable of compiling those codes as written in NR book and code files. I would appreciate anyone's help in this regard. Since I am a new learner of C/C++, I don't assume that I am doing it correctly and it's cygwin incompatibility issue. But, just in need of some clarification.
I have attached the code I am trying to compile and run.
Sincerely
Ashur
__________________
cc rational_function_interpolation.c -o rational_function_interpolation
rational_function_interpolation.c:1:25: fatal error: ../code/nr3.h: No such file or directory
#include <../code/nr3.h>
^
compilation terminated.
<builtin>: recipe for target 'rational_function_interpolation' failed
make: *** [rational_function_interpolation] Error 1
__________________
I have tried to follow all the suggestions in some posts of nr.com/forum but it seems that none is working for me. I think maybe cygwin is not capable of compiling those codes as written in NR book and code files. I would appreciate anyone's help in this regard. Since I am a new learner of C/C++, I don't assume that I am doing it correctly and it's cygwin incompatibility issue. But, just in need of some clarification.
I have attached the code I am trying to compile and run.
Sincerely
Ashur