How to create object file by using the two source files in unix

I have two source files named generate.cpp and Log.cpp

here i want to create generate.o by using these two files

can any body help me.
1 answer Last reply
More about create object file source files unix
  1. Why would you want to do that? You normally keep source files and object files in sync so that when remaking you only need to build the object file that has changed. You then combine the separate object files to create a library or an executable.

    If you really want to create one object file, you could #include one in the other.

    If your compiler is gcc and your source language is C you can use the "-combine" switch, but I don't think this works with C++.
Ask a new question

Read More