I have these files in SOURCE folder:

main.cpp
header.hpp
implement.cpp

I want that when I compile these codes, the object files and the .exe files will be found on the different folder, let's say in folder EXECUTE that is outside the folder SOURCE.

Like this:

/home/usr/SOURCE
* main.cpp
* implement.cpp
* header.cpp
/home/usr/EXECUTE
* main.o
* implement.o
* main.exe

Is this possible? If it is, How? I am using UNIX.

Thank you very much...

>>Is this possible? If it is, How?
yes, use the -o option and specify the full path to the name of the object file. BTW: *nix doesn't use MS-Windows .EXE naming convention -- executables can, but normally do not have an extension.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.