My C is a little rusty, but I figured there’s no time like the present to brush up on it again. I’ve tried programming literally the simplest program I can (see Image), and yet, it does not run.
The error message:
/tmp/ccxkSGWz.o: In function
main': main.c:(.text+0x15): undefined reference tofoo’
collect2: error: ld returned 1 exit status
When I move the actual function declaration to the .h file it does just fine. But I know I shouldn’t have to do that. That makes me think there’s a disconnect between my test.c and test.h files?
I suspect it’s not necessarily an Atom problem, since I get the same error when I compile with gcc on the command line.
Any thoughts as to what is going on?