I use the following code to compile a cpp file to object file.
g++ -c main.cpp
Above code generates the .o fles in same directory where main.cpp resides.
- Suppose I have a folder named obj and need to generate the object files there, how do I write?
- How can I see the compiler switches supported by g++ and it's usages?
Any help would be great