The error message is coming from the linker - by default, after compiling the modules you specified, the compiler will invoke the linker to link the object files into an executable. If the modules you specified do not contain an entry point (main function), the linker will complain. You can suppress invoking the linker by supplying the -c
switch to the compiler.
See this answer for more information.