I have two files, main.o
and modules.o
, and I'm trying to compile them so that main.o
can call functions in modules.o
. I was explicitly told not to try #include module.o
. I really don't know what I should be doing instead. I tried a few different versions of gcc
(such as gcc -x c driver main.o modules.o
), but nothing I get works: the compiler continuously returns
error: called object is not a function
The .o
files are my source code files (I was instructed to put my source code in files with extension .o
.) What do I do to compile this?
.o
files? That seemed incredibly strange to me, especially sincegcc
doesn't recognize.o
files, but that's why I came to you guys!.o
files, you can link them. Same goes for#include
: it goes into.c
files, not in.o
files..o
files are what.c
files are often compiled into. You should not name your files with a.o
extension if they contain C source code.