[previous_group] [previous] [up] * [next_group]

Link Time Errors

When we compile, we get the error:
stock1.c: In function âmainâ:
stock1.c:27: warning: incompatible implicit declaration of built-in function âprintfâ
/tmp/cc4Y2Z9O.o(.text+0xa3): In function `main':
stock1.c: undefined reference to `prinf'
collect2: ld returned 1 exit status


What does this mean?

This is called a link time error. The program compiled succesfully (we spoke correct C), but when the object file was linked, there was no function called prinf() in either our file or any library file.

We spelled printf() incorrectly.

Fixing that, the program compiles to an executable file, a.out. We run the program and get:

You have 57 shares of stock
selling at $3 8/130

The value of your portfolio is $627.000000

Any problems?


[up] to Overview.

[next_group]