Linking error in simple C program using a C++ header
I am following an intro tutorial http://www.linuxinsight.com/files/alp/alp-ch01-getting-started.pdf.

I have created the source files main.c, reciprocal.cpp and reciprocal.hpp. I have been able to successfully compile these files. The problem comes when I go to link them and I receive the following error message:

    main.o: In function `main':
    main.c:(.text+0x30): undefined reference to `reciprocal'
    collect2: ld returned 1 exit status

 I gather that this is somehow not using the header files correctly, however I do not really know what to try as I've followed the steps quite thoroughly.

If anyone has an idea why its throwing that error I would appreciate it very much.

Thanks
Linking error in simple C program using a C++ header
===

I am following an intro tutorial http://www.linuxinsight.com/files/alp/alp-ch01-getting-started.pdf.

I have created the source files main.c, reciprocal.cpp and reciprocal.hpp. I have been able to successfully compile these files. The problem comes when I go to link them and I receive the following error message:

    main.o: In function `main':
    main.c:(.text+0x30): undefined reference to `reciprocal'
    collect2: ld returned 1 exit status

 I gather that this is somehow not using the header files correctly, however I do not really know what to try as I've followed the steps quite thoroughly.

If anyone has an idea why its throwing that error I would appreciate it very much.

Thanks