954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

dealing with object files

is it possible that when I do this:

g++ -c function.cpp

the function.o will be generated in the other directory?

say for example i have FUNC folder

FUNC/function.cpp

I want to generate a function.o that is outside the FUNC folder.

thanx in advance....

squinx22
Junior Poster in Training
68 posts since Mar 2007
Reputation Points: 7
Solved Threads: 2
 

Yes. Just use the -o option of gcc.

g++ -c function.cpp -o /OBJECTNAME.o

WolfPack
Postaholic
Moderator
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You