Yes you can compile into an object file. For example, do "gcc -c xyz.c" to get object file xyz.o
To later get an executable, you have to link together mutiple object files. You can use gcc/g++ for the same purpose. gcc/g++ also have linking functionality in addition to compiler functionality.