I am having trouble linking these 3 files. I copied them directly from the book, but i cant seem to find the problem. I did some research and i found out something about having to put the function prototypes in main. I am using Dev c++ and these are the errors that im getting.
[Linker error] undefined reference to `rect_to_polar(rect)'
[Linker error] undefined reference to `show_polar(polar)'
Can someone please tell me what im doing wrong
coordin.h
Are both .cpp files set to be compiled? Linker errors are caused by the compiler finding a function declaration, but not the definition (i.e. the .cpp file with the definition wasn't compiled).
Is there an option for "Build Project", "Build Solution", "Build All" or something similar.
PS: It seems that many people on this forum (probably including me) would recommend against use of Dev C++, as you can see here http://www.cplusplus.com/forum/articles/36896/
You should try Visual C++ Express or Code::Blocks :)
There should be a button that looks like a box with an arrow pointing into it. Click on it and then add the other source file. You must have them in a project though, not just by themselves.
I tried putting them in a project but the same errors keep appearing. I downloaded code blocks and it still gives me the same errors. I guess it might be some error in my code or im not linking them properly.
wow im such an idiot, can someone please slap me lol. I just got them to work both on dev c++ and code blocks. I had to add each file into a project file, and then just compile them. Thanks to everyone who helped me.