Sign in with
Sign up | Sign in
Your question

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

Tags:
Last response: in Linux/Free BSD
Share
March 24, 2010 4:09:37 AM

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.
March 24, 2010 6:50:07 AM

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++.
m
0
l
Related resources
!