C program - Undefined reference error
Hi All,
I'm building my main program on SUSE using C, but the compiler returns the error below. Any suggestions? Thanks in advance. Code:
undefined reference to `init_aacgm' Code:
#include <stdio.h> |
Undefined reference means the compiler cannot find the two functions in question. Do you recognise the two functions?
|
This is a problem with the linker - the compiler's come along and successfully turned your C source (.c) file into an object (.o) file, and now the linker's trying to turn your object file(s) into an executable file. I assume the two functions in question are defined by yourself in another file?
You have two options:
Either way, gcc has to be able to find all your symbols (i.e. see all the relevant object files) at link-time. [shameless_plug] For more in-depth information, see the first few posts of my rather technical blog. [/shameless_plug]; |
Thank you both!
Compiles a-ok! |
All times are GMT -5. The time now is 07:03 PM. |