当前位置: 动力学知识库 > 问答 > 编程问答 >

c++ - Command line arguments with CodeBlocks

问题描述:

So, I have been using CodeBlocks IDE for compiling my C and C++ programs. But I want to run the program from the command line. How do I go about this?

P.S I want to run it on Windows platform.

网友答案:

If you want to build a Code::Blocks workspace from the command line, use codeblocks.exe --build --target=W32_Release --no-batch-window-close MyApp.workspace where MyApp.workspace is your workspace. If you want to build a program from the command line without using Code::Blocks, use gcc -O2 program.c -o program where program.c is your program, or g++ -O2 program.cpp -o program for C++. You can get gcc & g++ from here.

分享给朋友:
您可能感兴趣的文章:
随机阅读: