简体   繁体   中英

How do I set up GCC Compiler to Save Executables to a Subfolder?

I do a LOT of programming in my C++ class, and I have about 60 .cpp, .o, and .exe files all piled together in one folder. Is there any way that I can tell the compiler to save the executable file to a different directory? Like add a value --output C:/C++/Executables/ instead of C:/C++/?

Thanks in advance! Gage Henry

PS: G++ Compiler, Running Code::Blocks

相应的编译器选项是-o

To set it up in Code::Blocks

  1. Load up the project file.
  2. From the Projects Menu select Properties... Menu item
  3. Click on the Build targets tab
  4. If you have a build target skip to step 6.
  5. Add a build target

    5.1. Click on the Add button 5.2. Enter a name for your build target

  6. Select your Build target in the left column.

  7. Click on the folder button to the right of the Execution working directory text box
  8. Create a folder for your test target and there you go
  9. Do the same for Objects output dir:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM