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 could I write it?
- How can I see the compiler switches supported by g++ and it’s usages?
Any help would be great
Use:
If you are on a *nix system use:
or use
info g++