wayne
发表于 2011-4-27 13:27:24
60# liangbch
dev-cpp 连续六年没有更新,自然GCC也是很老很老的。
====================
用dev-cpp 还不如用code::blocks
▄︻┻═┳一‥
发表于 2011-4-27 13:29:23
本帖最后由 ▄︻┻═┳一‥ 于 2011-4-27 13:31 编辑
61# wayne
code::blocks 好像不支持命令行编译。
wayne
发表于 2011-4-27 13:30:14
62# ▄︻┻═┳一‥
你的意思是说dev-cpp支持命令行。。。。
▄︻┻═┳一‥
发表于 2011-4-27 13:35:16
63# wayne
恩,你在devcpp的bin目录下可以用cmd 查看 gcc --help
▄︻┻═┳一‥
发表于 2011-4-27 13:38:50
dev-cpp里面的gccC:\Program Files\Dev-Cpp\bin
->gcc --help
Usage: gcc file...
Options:
-pass-exit-codes Exit with highest error code from a phase
--help Display this information
--target-help Display target specific command line options
(Use '-v --help' to display command line options of sub-processes)
-dumpspecs Display all of the built in spec strings
-dumpversion Display the version of the compiler
-dumpmachine Display the compiler's target processor
-print-search-dirs Display the directories in the compiler's search path
-print-libgcc-file-nameDisplay the name of the compiler's companion library
-print-file-name=<lib> Display the full path to library <lib>
-print-prog-name=<prog>Display the full path to compiler component <prog>
-print-multi-directory Display the root directory for versions of libgcc
-print-multi-lib Display the mapping between command line options and
multiple library search directories
-print-multi-os-directory Display the relative path to OS libraries
-Wa,<options> Pass comma-separated <options> on to the assembler
-Wp,<options> Pass comma-separated <options> on to the preprocessor
-Wl,<options> Pass comma-separated <options> on to the linker
-Xlinker <arg> Pass <arg> on to the linker
-save-temps Do not delete intermediate files
-pipe Use pipes rather than intermediate files
-time Time the execution of each subprocess
-specs=<file> Override built-in specs with the contents of <file>
-std=<standard> Assume that the input sources are for <standard>
-B <directory> Add <directory> to the compiler's search paths
-b <machine> Run gcc for target <machine>, if installed
-V <version> Run gcc version number <version>, if installed
-v Display the programs invoked by the compiler
-### Like -v but options quoted and commands not executed
-E Preprocess only; do not compile, assemble or link
-S Compile only; do not assemble or link
-c Compile and assemble, but do not link
-o <file> Place the output into <file>
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension
Options starting with -g, -f, -m, -O, -W, or --param are automatically
passed on to the various sub-processes invoked by gcc.In order to pass
other options on to these processes the -W<letter> options must be used.
For bug reporting instructions, please see:
<URL:http://www.mingw.org/bugs.shtml>.mingw 里面的gcc:C:\MinGW\bin
->gcc --help
Usage: gcc file...
Options:
-pass-exit-codes Exit with highest error code from a phase
--help Display this information
--target-help Display target specific command line options
--help={target|optimizers|warnings|params|[^]{joined|separate|undocumented}}[,
...]
Display specific types of command line options
(Use '-v --help' to display command line options of sub-processes)
--version Display compiler version information
-dumpspecs Display all of the built in spec strings
-dumpversion Display the version of the compiler
-dumpmachine Display the compiler's target processor
-print-search-dirs Display the directories in the compiler's search path
-print-libgcc-file-nameDisplay the name of the compiler's companion library
-print-file-name=<lib> Display the full path to library <lib>
-print-prog-name=<prog>Display the full path to compiler component <prog>
-print-multi-directory Display the root directory for versions of libgcc
-print-multi-lib Display the mapping between command line options and
multiple library search directories
-print-multi-os-directory Display the relative path to OS libraries
-print-sysroot Display the target libraries directory
-print-sysroot-headers-suffix Display the sysroot suffix used to find headers
-Wa,<options> Pass comma-separated <options> on to the assembler
-Wp,<options> Pass comma-separated <options> on to the preprocessor
-Wl,<options> Pass comma-separated <options> on to the linker
-Xassembler <arg> Pass <arg> on to the assembler
-Xpreprocessor <arg> Pass <arg> on to the preprocessor
-Xlinker <arg> Pass <arg> on to the linker
-combine Pass multiple source files to compiler at once
-save-temps Do not delete intermediate files
-save-temps=<arg> Do not delete intermediate files
-no-canonical-prefixes Do not canonicalize paths when building relative
prefixes to other gcc components
-pipe Use pipes rather than intermediate files
-time Time the execution of each subprocess
-specs=<file> Override built-in specs with the contents of <file>
-std=<standard> Assume that the input sources are for <standard>
--sysroot=<directory> Use <directory> as the root directory for headers
and libraries
-B <directory> Add <directory> to the compiler's search paths
-b <machine> Run gcc for target <machine>, if installed
-V <version> Run gcc version number <version>, if installed
-v Display the programs invoked by the compiler
-### Like -v but options quoted and commands not executed
-E Preprocess only; do not compile, assemble or link
-S Compile only; do not assemble or link
-c Compile and assemble, but do not link
-o <file> Place the output into <file>
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension
Options starting with -g, -f, -m, -O, -W, or --param are automatically
passed on to the various sub-processes invoked by gcc.In order to pass
other options on to these processes the -W<letter> options must be used.
For bug reporting instructions, please see:
<http://gcc.gnu.org/bugs.html>.
->
wayne
发表于 2011-4-27 21:45:04
64# ▄︻┻═┳一‥
额,你这个不能叫dev-cpp的命令行。。。
▄︻┻═┳一‥
发表于 2011-4-28 06:39:51
66# wayne D:\program files\CodeBlocks>dir/a/b/s *.exe
D:\program files\CodeBlocks\cb_console_runner.exe
D:\program files\CodeBlocks\codeblocks.exe
D:\program files\CodeBlocks\uninstall.exe
wayne
发表于 2011-4-28 06:45:19
67# ▄︻┻═┳一‥
这样的命令才差不多,呵呵,个人感觉。
liangbch
发表于 2011-5-6 20:54:41
5# plp626
奉上我的批处理习作。我的第一个用于数值计算的批处理程序。这个程序可计算n的阶乘。n>=1, 代码如下:@echo off
setlocal enabledelayedexpansion
echo To calculate n^^!
set/p nn=n=?
set/a "buff_1=1,rad=10000,len=1"
for /l %%i in (1,1,%nn% ) do (
set/a cc=0
for /l %%j in (1,1,!len!) do (
set/a "tt=buff_%%j* %%i+!cc!"
set/a "buff_%%j=!tt! %% !rad!,cc=!tt!/!rad!"
)
if!cc! gtr 0 (
set/a len+=1
set/a buff_!len!=!cc!
)
)
set/p xx=n^^!=<nul
set/a tt=buff_%len%
set/p xx=!tt!<nul
set/a len-=1
for /l %%i in (%len%,-1,1 ) do (
set/a tt=buff_%%i
if !tt! lss 1000 set tt=00000!tt!
set/p xx=!tt:~-4!<nul
)
echo.
G-Spider
发表于 2011-5-16 20:40:06
向上面的两位求助。
有个提取文本,想用批处理完成。
有多个*.html 文件,要求提取出 <pre> A </pre>之间的c 数据结构A.
A中有<>也要去掉,得到的c语言数据结构A保存到同一个文本文件中。
比如:<pre>
typedef struct _ALPC_HANDLE_TABLE // 4 elements, 0x18 bytes (sizeof)
{
/*0x000*/ struct <a href="ALPC_HANDLE_ENTRY.html">_ALPC_HANDLE_ENTRY</a>* Handles;
/*0x008*/ ULONG32 TotalHandles;
/*0x00C*/ ULONG32 Flags;
/*0x010*/ struct <a href="EX_PUSH_LOCK.html">_EX_PUSH_LOCK</a> Lock; // 7 elements, 0x8 bytes (sizeof)
}ALPC_HANDLE_TABLE, *PALPC_HANDLE_TABLE;
</pre>变成:typedef struct _ALPC_HANDLE_TABLE // 4 elements, 0x18 bytes (sizeof)
{
/*0x000*/ struct _ALPC_HANDLE_ENTRY* Handles;
/*0x008*/ ULONG32 TotalHandles;
/*0x00C*/ ULONG32 Flags;
/*0x010*/ struct _EX_PUSH_LOCK Lock; // 7 elements, 0x8 bytes (sizeof)
}ALPC_HANDLE_TABLE, *PALPC_HANDLE_TABLE;