gp编译
① 如何在Windows平台下使用GCC编译器
MinGW是指只用自由软件来生成纯粹的Win32可执行文件的编译环境,它是Minimalist GNU on Windows的略称。
实际上 MinGW 并不是一个 单纯的C/C++ 编译器,而是一套 GNU 工具集合。除开 GCC 以外,MinGW 还包含有一些其他的 GNU 程序开发工具 (比如 gawk bison 等等)。
开发 MinGW 是为了那些不喜欢工作在 linux(FreeBSD) 操作系统而留在 Windows 的人提供一套符合 GNU 的 GNU 工作环境。
所以,使用 MinGW 我们就可以像在 Linux 下一样使用 GNU 程序开发工具。
GCC 就是 MinGW 的核心所在,GCC 是一套支持众多计算机程序语言的编译系统,而且在语言标准的实现上是最接近于标准的。并且 GCC
几乎可以移植到目前所有可用的计算机平台。(我的电脑上就还装有 DevKitPro,里面包含 GCC 的 ARM(for GBA/DS/GP32)
和 MIPS(for PSP) 版本。)
GCC 本身不像 VC 那样拥有IDE 界面(在 Windows 上也存在 Dev C++ 之类的支持 MinGW 编译器的
IDE)。源代码编辑你可以选用任何你喜欢的文本编辑器(据说微软的开发人员包括 VC 的开发都不用 VC 所带的 IDE 编辑器,而是选用 GNU
的 VIM 编辑器)。然后使用 make 等工具来进行软件项目的编译、链接、打包乃至发布。而像 cvs(svn)
源代码版本控制工具可以让世界上任何一个角落的人都可以参与到软件项目中来。
2.下载MinGW
一种方法是到Sourceforge(http://sourceforge.net/project/showfiles.php?group_id=2435)下载一个MinGW-2.0.0-3.exe。
但是我配置的时候我电脑上安装了codeblocks,已经自带了MinGW。
3.环境变量的配置
在(系统属性-->高级-->环境变量-->系统变量 中)(以下目录都根据自己的电脑MinGW所在位置不同而改变)
a.在PATH的值中加入“C:\Program Files\MinGWStudio\MinGW\bin”。这是寻找gcc编译器的路径。如果PATH中还有其他内容,需要用英文状态下分号进行分割
b.新建LIBRARY_PATH变量,在其值中加入“C:\Program Files\MinGWStudio\MinGW\lib”。这是标准库存放的路径。
c.新建C_INCLUDE_PATH变量,在其值中加入“C:\Program Files\MinGWStudio\MinGW\include”。这是Include查找头文件的路径。
4.验证gcc是否正常运行
在cmd控制台窗口下面,输入gcc -v。若已经成功安装好,会显示gcc的版本信息。
② 如何解决GP显示乱码的问题
解决gp中文乱码的4种方法
一、JSP页面显示乱码
下面的显示页面(display.jsp)就出现乱码:
程序代码
<html>
<head>
<title>JSP的中文处理</title>
<meta http-equiv="Content-Type" c>
</head>
<body>
<%
out.print("JSP的中文处理");
%>
</body>
</html>
对不同的WEB服务器和不同的JDK版本,处理结果就不一样。原因:服务器使用的编码方式不同和浏览器对不同的字符显示结果不同而导致的。解决办法:在JSP页面中指定编码方式(gb2312),即在页面的第一行加上:<%@ page c%>,就可以消除乱码了。完整页面如下:
<%@ page c%>
<html>
<head>
<title>JSP的中文处理</title>
<meta http-equiv="Content-Type" c>
</head>
<body>
<%
out.print("JSP的中文处理");
%>
</body>
</html>
二、表单提交中文时出现乱码
下面是一个提交页面(submit.jsp),代码如下:
程序代码
<html>
<head>
<title>JSP的中文处理</title>
<meta http-equiv="Content-Type" c>
</head>
<body>
<form name="form1" method="post" action="process.jsp">
<div align="center">
<input type="text" name="name">
<input type="submit" name="Submit" value="Submit">
</div>
</form>
</body>
</html>
下面是处理页面(process.jsp)代码:
程序代码
<%@ page c%>
<html>
<head>
<title>JSP的中文处理</title>
<meta http-equiv="Content-Type" c>
</head>
<body>
<%=request.getParameter("name")%>
</body>
</html>
如果submit.jsp提交英文字符能正确显示,如果提交中文时就会出现乱码。原因:浏览器默认使用UTF-8编码方式来发送请求,而UTF-8和GB2312编码方式表示字符时不一样,这样就出现了不能识别字符。解决办法:通过request.seCharacterEncoding("gb2312")对请求进行统一编码,就实现了中文的正常显示。修改后的process.jsp代码如下:
程序代码
<%@ page c%>
<%
request.seCharacterEncoding("gb2312");
%>
<html>
<head>
<title>JSP的中文处理</title>
<meta http-equiv="Content-Type" c>
</head>
<body>
<%=request.getParameter("name")%>
</body>
</html>
三、数据库连接出现乱码
只要涉及中文的地方全部是乱码,解决办法:在数据库的数据库URL中加上useUnicode=true&characterEncoding=GBK就OK了。
四、数据库的显示乱码
在mysql4.1.0中,varchar类型,text类型就会出现中文乱码,对于varchar类型把它设为binary属性就可以解决中文问题,对于text类型就要用一个编码转换类来处理,实现如下:
程序代码
public class Convert {
/** 把ISO-8859-1码转换成GB2312
*/
public static String ISOtoGB(String iso){
String gb;
try{
if(iso.equals("") || iso == null){
return "";
}
else{
iso = iso.trim();
gb = new String(iso.getBytes("ISO-8859-1"),"GB2312");
return gb;
}
}
catch(Exception e){
System.err.print("编码转换错误:"+e.getMessage());
return "";
}
}
}
把它编译成class,就可以调用Convert类的静态方法ISOtoGB()来转换编码。
③ 高通android指纹模块怎么编译
fp_shutdown_active {
qcom,pins = <&gp 23>;
qcom,pin-func = <0>;
qcom,num-grp-pins = <1>;
label = "shutdown_gpio_active";
fp_shutdown_active: fp_shutdown_active {
drive-strength = <6>;
<span style="color:#ff0000;">output-high;</span>
bias-disable= <0>;
};
};
fp_shutdown_suspend {
qcom,pins = <&gp 23>;
qcom,pin-func = <0>;
qcom,num-grp-pins = <1>;
label = "shutdown_gpio_suspend";
fp_shutdown_suspend: fp_shutdown_suspend {
drive-strength = <2>;
<span style="color:#ff0000;">out
④ 正在编译现行程序 正在检查重复名称... 正在预处理现行程序 正在进行名称连接... 正在统计需要编译的子程
这是表示你没有 别注册热键程序 这个子程序
你可以用程序里面的一个 注册热键 + 撤锁热键 这两条命令啊,
这个肯定是别人使用了模块的,
.版本 2
.支持库 shellEx
.程序集 窗口程序集1
.程序集变量 F1, , , , 热键标识
.子程序 __启动窗口_创建完毕
F1 = 注册热键 (取窗口句柄 (), 标签1.取窗口句柄 (), 0, #F1键)
.子程序 __启动窗口_将被销毁
撤销热键 (取窗口句柄 (), F1)
.子程序 _标签1_反馈事件, 整数型
.参数 参数一, 整数型
.参数 参数二, 整数型
.如果真 (参数一 = F1)
信息框 (“看到了没有,热键注册成功”, 0, )
.如果真结束
⑤ 安卓手机怎么使GuitarPro这个软件,下载的gp格式文件怎么找到和打开
没有。安卓手机支持的是“apk “‘文件,只有windowphone才支持exe文件,塞班支持jar与sisx 。三者不同的系统有不同的支持功能。 原因:安卓是用java语言写的,EXE是用C,VB,E语言写的。之间没有任何共价连接,也无法再手机上完成打包安装以及启动。 注意:能打开exe格式的手机只有微软最早出的 windows mobile 6.0 6.1 和6.5支持cab格式与极少数exe格式的程序。 但是,安卓机是神机,可以借助一些模拟器与镜像来实现。具体比较麻烦。主要用到bochs与配置文件和镜像,后两者需要网上如XDA论坛下载。 我可以教给你的是靠软件模拟一个x86环境,来运行原来只能运行在x86平台的系统,也就是模拟器虚拟机。经过一番尝试,成功运行起win98、winxp、debian linux,理论上也能运行其它pc系统。例如Win7甚至Win8. 在教给你如何运行windows之前先简单介绍下Bochs。 Bochs是一种十分轻便的使用c++编写的开源IA-32(x86)电脑模拟器,可以运行在最受欢迎的平台上。它仿真英特尔x86 CPU、常见的I/O设备、和定制的BIOS。目前,Bochs可以被编译仿真386、486、Pentium/PentiumII/PentiumIII/Pentium4或x86-64位的CPU,包括可选的MMX,SSEx和3DNow指令。在Bochs仿真环境里能够运行许多操作系统,比如Linux、DOS、Windows 95/98/NT/2000/XP或者Windows Vista。Bochs是由凯文·劳顿编写的,目前由Bochs项目组维护。 Bochs可以被编译运用在多种模式下,其中有些仍处于发展中。bochs的典型应用是提供x86 PC的完整仿真,包括x86处理器、硬件设备、和存储器。这让您在您的工作站上的模拟器里运行操作系统和软件,就像你有一台机器内的机器。例如,Bochs还将允许您在安装X11的Solaris机上运行windows应用程序。 首先说下需要的东西: 1模拟器主程序(就是一个apk程序文件) 2配置文件(已经打包好在附件里) 3系统镜像 步骤1:安装模拟器主程序(这个就不用多说了,和普通安卓应用一样) 步骤2:将装有配置文件的SDL文件夹拷贝到机身内存根目录中(没有机身内存的手机请拷贝到SD卡中,不清楚拷贝到哪里的就用RE管理器拷贝到手机根目录显示sdcard的文件夹里) 步骤3:将系统镜像文件改名为c.img,拷贝到步骤2中的SDL文件夹(要用什么系统就拷贝相应的镜像) 步骤4:运行安装好的模拟器主程序,没有问题的话就会开机运行操作系统了
⑥ C++中,什么是GP
泛型编程也就是GP(Generic Programming),推崇与类型无关的编程思想。简单来说,就是将针对不同数据类型的相同算法从数据结构<类>中剥离出来,
这与传统的C++的继承和多态截然不同。
可以说泛型思想中没有多少继承和多态的成分。甚至有背道而驰的味道。
在C++实现上,泛型严重依赖于模板机制,事实上如果没有模板的引入,泛型绝对不会在C++语言中获得如此巨大的成功!
泛型代码由C++编译器在编译期解释成二进制代码。也就是说,泛型的代码编译起来可能会使程序的二进制代码变大,但这一点也保证了程序在运行的时候不会损失效率...
当然泛型不是万能的,滥用泛型也许一样会使你的代码缓慢...
工具毕竟还是工具,思想和方法总有其局限性的。
如果没接触过,学习泛型编程,对你是一个全新的体验 。
⑦ C语言编译失败
打开vc界面 点击VC“TOOLS(工具)”—>“Option(选择)”
—>“Directories(目录)”重新设置“Excutable Fils、Include Files、
Library Files、Source Files”的路径。很多情况可能就一个盘符的不同
(例如你的VC装在C,但是这些路径全部在D),改过来就OK了。
如果你是按照初始路径安装vc6.0的,路径应为:
executatble files:
C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin
C:\Program Files\Microsoft Visual Studio\VC98\BIN
C:\Program Files\Microsoft Visual Studio\Common\TOOLS
C:\Program Files\Microsoft Visual Studio\Common\TOOLS\WINNT
include files:
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE
library files:
C:\Program Files\Microsoft Visual Studio\VC98\LIB
C:\Program Files\Microsoft Visual Studio\VC98\MFC\LIB
source files:
C:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\CRT\SRC
如果你装在其他盘里,则仿照其路径变通就行(我就是装在D盘)。
关键是microsoft visual studio\ 后面的东西要相同。
本人深受其害,重装多次不管用,上面中文部分为高手借鉴,
下面路径为本人深思所得,终于解决。与君分享。
vc中出现“没有找到mspdb60.dll文件”时:
将C:\Program Files\Microsoft Visual Studio 6\Common\MSDev98\Bin下的mspdb60.dll
文件拷贝到C:\Program Files\Microsoft Visual Studio 6\VC98\Bin目录下即可。
⑧ 威纶触摸屏编译时出现窗口10GP_0:此图片为空白是什么原因
可能原因:1.图片尺寸过大。2.图片格式不正确。
⑨ Delphi的命令行编译命令
Borland出品的Delphi,有着闪电般的编译速度,但是在界面控件使用较多、工程项目较大的时候,编译一个工程仍需要一段时间,打开庞大的Delphi IDE,也需要时间。其实,在一个工程开发结束,调试完成之后的Release编译,完全可以用命令行来执行,因为Delphi的编译器参数不像C++编译器那样复杂。
笔者把Delphi联机手册中关于命令行编译(command-line compiler)的几篇主题作了翻译,希望对Delphi开发人员有帮助。
目录
1. Command-line compiler
命令行编译器
2. Command-line compiler options
命令行编译器选项
3. Compiler directive options
编译器指令选项
4. Compiler mode options
编译模式选项
5. DCC32.CFG file
编译器配置文件DCC32.CFG
6. Debug options
调试选项
7. Directory options
目录选项
8. IDE command-line options
IDE命令行选项
9. Generated files
几个IDE自动生成的文件介绍
Command-line compiler
命令行编译器
Delphi's command-line compiler (dcc32.EXE) lets you invoke all the functions of the IDE compiler (DELPHI32.EXE) from the DOS command line (see IDE command-line options. Run the command-line compiler from the DOS prompt using the syntax:
Delphi’s命令行编译器(dcc32.exe)允许你从DOS命令行方式(参照:IDE命令行选项)实现IDE编译器(delphi32.exe)的所有功能。用DOS命令运行命令行编译器语法如下:
dcc32 [options] filename [options]
dcc32 [选项] [文件名] [选项]
where options are zero or more parameters that provide information to the compiler and filename is the name of the source file to compile. If you type dcc32 alone, it displays a help screen of command-line options and syntax.
零或多个参数给编译器提供信息,文件名指定需要编译的源文件名。如果你单独输入dcc32,它会显示一个关于命令行编译的选项和语法的屏幕。
If filename does not have an extension, the command-line compiler assumes .dpr, then .pas, if no .dpr is found. If the file you're compiling to doesn't have an extension, you must append a period (.) to the end of the filename.
如果文件名没有扩展名,命令行编译器会查找扩展名为.dpr的同名文件,如果找不到,则查找扩展名为.pas的同名文件。如果你的源文件确实没有扩展名,你需要在文件名的末尾添加(.)。
If the source text contained in filename is a program, the compiler creates an executable file named filename.EXE. If filename contains a library, the compiler creates a file named filename.DLL. If filename contains a package, the compiler creates a file named filename.BPL. If filename contains a unit, the compiler creates a unit file named filename.dcu.
如果指定的源文件是一个工程文件,编译器会创建一个扩展名为.EXE的同名可执行文件。如果指定的源文件是一个库文件,编译器创建一个扩展名为.DLL的同名动态链接库文件。如果指定的源文件是一个包文件,编译器会创建一个扩展名为.BPL的同名包。如果指定的源文件是一个单元文件,编译器会创建一个扩展名为.dcu的目标代码文件。
You can specify a number of options for the command-line compiler. An option consists of a slash (/) or immediately followed by an option letter. In some cases, the option letter is followed by additional information, such as a number, a symbol, or a directory name. Options can be given in any order and can come before or after the file name.
你可以为命令行编译器指定多个参数。一个参数包含一个破折号“-”(或“/”)和紧跟着的一个选项字符构成。通常情况下,选项字符后面会跟一些附加的信息,如一个数字、一个符号、一个目录等。选项可以是任意顺序并且可以在源文件名前面或后面。
Command-line compiler options
命令行编译选项
The IDE lets you set various options through the menus; the command-line compiler gives you access to these options using the slash (/) delimiter. You can also precede options with a hyphen (-) instead of a slash (/), but those options that start with a hyphen must be separated by blanks. For example, the following two command lines are equivalent and legal:
IDE允许你使用菜单来设置各种编译选项,而命令行编译器允许你使用字符“/”作为分隔符来设定这些编译选项。你也可以使用连字符“-”来代替“/”,但是用“-”引出的参数之间必须用空格隔开。例如,下面两个命令都是等同的也是合法的:
DCC -IC:\DELPHI -DDEBUG SORTNAME -$R- -$U+
DCC /IC:\DELPHI/DDEBUG SORTNAME /$R-/$U+
The first command line uses hyphens with at least one blank separating options. The second uses slashes and no separation is needed.
第一个编译命令用“-”引出参数,且参数之间有多个空格分隔。第二个编译命令用“/”引出参数,参数之间不必要分隔。
The following table lists the command-line options. In addition to the listed options, all single-letter compiler directives can be specified on the command line, as described in Compiler directive options.
下列表中列出所有的命令行参数。在附加的选项列表中,所有的单字符编译器指令都可以在命令行编译中使用,详情请参照:编译器指令。
Option Description
选项 描述
Aunit=alias 设置单元别名
B 编译所有单元
CC 编译控制台程序
CG 编译图形界面程序
Ddefines 编译条件符号定义
Epath 可执行文件输出路径
Foffset 查找运行期间错误
GD 生成完整.Map文件
GP 生成.Map文件Public段
GS 生成.Map文件Segment段
H 输出提示信息
Ipaths 文件包含路径
J 生成.Obj目标文件
JP 生成C++类型.Obj目标文件
Kaddress Set image base address
LEpath 包.BPL文件输出路径
LNpath .dcp文件输出路径
LUpackage 使用运行期间包列表
M 编译有改动的源文件
Npath dcu/dpu文件输出目录
Opaths .Obj文件(汇编目标代码文件)路径
P 按8.3格式文件名查找
Q 安静模式
Rpaths 资源文件(.RES)路径
TXext 目标文件扩展名
Upaths 单元文件路径
V 为Turbo Debugger生成调试信息文件
VN 以.Giant格式生成包含命名空间的调试信息文件(将用于C++Builder)
VR 生成调试信息文件.rsm
W 输出警告信息
Z Disable implicit compilation
$directive Compiler directives
--Help 显示编译选项的帮助。同样的,如果你在命令行单独输入dcc32,也会显示编译选项的帮助。
--version 显示产品名称和版本
Compiler directive options
编译器指令选项
Delphi supports the compiler directives described in Compiler directives. The $ and D command-line options allow you to change the default states of most compiler directives. Using $ and D on the command line is equivalent to inserting the corresponding compiler directive at the beginning of each source file compiled.
Delphi支持用编译器指令关键字描述的编译器指令。使用“$”和“D”命令行选项可以改变所有的默认编译器状态。用“$”和“D”命令行选项等同于在源文件的前面添加编译器指令。
Switch directive option
编译器指令选项开关
The $ option lets you change the default state of all of the switch directives. The syntax of a switch directive option is $ followed by the directive letter, followed by a plus (+) or a minus (-). For example:
“$”允许你改变每一种编译器指令默认状态。编译器指令的语法是“$”后紧跟一个指令字符,再跟一个“-”或“+”。例如:
dcc32 MYSTUFF -$R-
compiles MYSTUFF.pas with range-checking turned off, while:
不使用边界检查编译MYSTUFF.pas单元:
dcc32 MYSTUFF -$R+
compiles it with range checking turned on. Note that if a {$R+} or {$R-} compiler directive appears in the source text, it overrides the -$R command-line option.
使用界面检查编译MYSTUFF.pas单元。如果将编译器指令{$R+}或{$R-}添加到源文件的开始,它将覆盖从命令行传入的参数。
You can repeat the -$ option in order to specify multiple compiler directives:
你可以用多个“$”来指定多个编译器指令,如:
dcc32 MYSTUFF -$R--$I--$V--$U+
Alternately, the command-line compiler lets you write a list of directives (except for $M), separated by commas:
命令行编译器允许作用逗号分隔的编译器指定列表,如:
dcc32 MYSTUFF -$R-,I-,V-,U+
只需要用一个“$”符号。
Only one dollar sign ($) is needed.
注意,因为$M的格式不一样,你不能在逗号分隔的指令列表中使用$M
Note that, because of its format, you cannot use the $M directive in a list of directives separated by commas.
Conditional defines option
条件编译选项
The -D option lets you define conditional symbols, corresponding to the {$DEFINE symbol} compiler directive. The -D option must be followed by one or more conditional symbols separated by semicolons (;). For example, the following command line:
“-D”选项允许你定义一个编译条件,符合你用{$DEFINE symbol}定义的编译器指令。“-D”选项后必须跟随一或多个用分号分隔的编译条件符号,如下命令:
dcc32 MYSTUFF -DIOCHECK;DEBUG;LIST
defines three conditional symbols, iocheck, debug, and list, for the compilation of MYSTUFF.pas. This is equivalent to inserting:
定义了三个编译条件符号:IOCHECK,DEBUG,LIST,用于MYSTUFF.pas单元中。这等同于在源文件中插入以下语句:
{$DEFINE IOCHECK}
{$DEFINE DEBUG}
{$DEFINE LIST}
at the beginning of MYSTUFF.pas. If you specify multiple -D directives, you can concatenate the symbol lists. Therefore:
如果你指定了多个“-D”选项,你可以联接它们,如下:
dcc32 MYSTUFF -DIOCHECK-DDEBUG-DLIST
is equivalent to the first example.
等同于第一个例子。
Compiler mode options
编译模式选项
A few options affect how the compiler itself functions. As with the other options, you can use these with either the hyphen or the slash format. Remember to separate the options with at least one blank.
有几个选项能影响编译器自身的功能。像其它选项一个,你可以使用“/”或“-”的格式。别忘了用至少一个空格分隔这些选项。
Make (-M) option
选项(-M)
The command-line compiler has built-in MAKE logic to aid in project maintenance. The -M option instructs command-line compiler to check all units upon which the file being compiled depends. Using this option results in a much quicker compile time.
命令行编译器使用构造逻辑的方式来维护工程。“-M”选项指示编译器检查所有与编译文件相关联的文件。用这个参数会导致编译时间增大。
A unit is recompiled under the following conditions:
一个源文件在下列情况下会重新编译:
The source file for that unit has been modified since the unit file was created.
源文件被创建以来被修改过;
用“$I”指令包含的任何文件,用“$L”包含的任何.Obj文件,或用“$R”关联的任何资源文件.Res,比源文件中的要新;
Any file included with the $I directive, any .OBJ file linked in by the $L directive, or any .res file referenced by the $R directive, is newer than the unit file.
The interface section of a unit referenced in a uses statement has changed.
单元接口部分interface的uses段有改动。
Units compiled with the -Z option are excluded from the make logic.
在单元编译时指令“-Z”在构造逻辑期不被接受。
If you were applying this option to the previous example, the command would be:
如果你在上一个例子中使用这个指令,编译命令就应该是:
dcc32 MYSTUFF -M
Build all (-B) option
编译所有 选项(-B)
Instead of relying on the -M option to determine what needs to be updated, you can tell command-line compiler to update all units upon which your program depends using the -B option. You can't use -M and -B at the same time. The -B option is slower than the -M option and is usually unnecessary.
用于取代要知道哪些单元需要更新-M的选项,你可以使用-B选项来更新所有你的程序中关联的单元。你不能在程序中同时使用-M和-B。选项-B比-M速度更慢,而且它并不是必需的。
If you were using this option in the previous example, the command would be
如果你在前一个例子中使用这个参数,编译命令就应该是:
dcc32 MYSTUFF -B
Find error (-F) option
查找错误 选项(-F)
When a program terminates e to a runtime error, it displays an error code and the address at which the error occurred. By specifying that address in a -Faddress option, you can locate the statement in the source text that caused the error, provided your program and units were compiled with debug information enabled (via the $D compiler directive).
当一个程序由于运行期间错误而终止时,它会显示一个错误号和错误地址在错误发生时。用-Faddress选项来指定错误地址,你在源文件中能找到引发错误的位置,如果你的程序和单元编译时附加了调试信息(使用$D编译器指令)。
In order for the command-line compiler to find the runtime error with -F, you must compile the program with all the same command-line parameters you used the first time you compiled it.
为了命令行编译器能用-F选项查找运行期间错误,你必须传递与第一次编译时相同的指令列表。
As mentioned previously, you must compile your program and units with debug information enabled for the command-line compiler to be able to find runtime errors. By default, all programs and units are compiled with debug information enabled, but if you turn it off, using a {$D-} compiler directive or a -$D- option, the command-line compiler will not be able to locate runtime errors.
先前提到过,你的程序和单元必须启用调试信息,命令行编译器才能查找运行期间错误。默认情况下,所有的程序和单都是启用调试信息的,除非你用{-D}或-$D-指令关闭它,这样,命令行编译器就不能查找运行期间错误了。
Use packages (-LU) option
使用包(-LU)选项
Use the -LU option to list additional runtime packages that you want to use in the application being compiled. Runtime packages already listed in the Project Options dialog box need not be repeated on the command line.
使用-LU选项来在编译时添加你应用程序中要用到的运行期间包。运行期间包已经在“工程选项”对话框中列举的,不必再在命令行中添加。
Disable implicit compilation (-Z) option
(此选项在delphi6.0/7.0中有不同描述,在此不作翻译)
The -Z option prevents packages and units from being implicitly recompiled later. With packages, it is equivalent to placing {$ IMPLICITBUILD OFF} in the .dpk file. Use -Z when compiling packages that provide low-level functionality, that change infrequently between builds, or whose source code will not be distributed.
Target file extension (-TX) option
目标文件扩展名(-TX)选项
The -TX option lets you override the default extension for the output file. For example,
选项-TX允许你改写默认的输出文件扩展名。例如:
dcc32 MYSTUFF -TXSYS
generates compiled output in a file called MYSTUFF.SYS.
生成的将是一个叫做MYSTUFF.SYS的文件。
Quiet (-Q) option
安静模式(-Q)选项
The quiet mode option suppresses the printing of file names and line numbers ring compilation. When the command-line compiler is invoked with the quiet mode option
安静模式选项禁止在编译时显示文件名及代码行数,如果命令行编译器调用这个选项的话。
dcc32 MYSTUFF -Q its output is limited to the startup right message and the usual statistics at the end of compilation. If any errors occur, they will be reported.
它的输出仅限于起始时行版权信息以及结尾的统计信息。当然,如果发生错误,它也会输出。
DCC32.CFG file
DCC32.CFG配置文件
You can set up a list of options in a configuration file called DCC32.CFG, which will then be used in addition to the options entered on the command line. Each line in configuration file corresponds to an extra command-line argument inserted before the actual command-line arguments. Thus, by creating a configuration file, you can change the default setting of any command-line option.
你可以设置一个编译选项列表到一个叫做DCC32.CFG的配置文件中,它将用于编译时附加到命令行参数后。配置文件的每一行都相当于一个额外的命令行参数插入到实际的命令行参数前(注意,是实际参数前)。因而,你可以使用这个配置文件改变一些命令行参数的默认设置。
The command-line compiler lets you enter the same command-line option several times, ignoring all but the last occurrence. This way, even though you've changed some settings with a configuration file, you can still override them on the command line.
命令行编译器允许你输入相同的命令行参数,它将忽略所有除最后一个之外。这个的话,尽管通过配置文件你可以改变一些设置,你仍然可以覆盖它使用命令行参数。
When dcc32 starts, it looks for DCC32.CFG in the current directory. If the file isn't found there, dcc32 looks in the directory where DCC32.EXE resides.
当dcc32启动时,它查找DCC32.CFG文件在当前目录。如果文件没有找到,dcc32会查找它所在的目录。
Here's an example DCC32.CFG file, defining some default directories for include, object, and unit files, and changing the default states of the $O and $R compiler directives:
以下是一个DCC32.CFG配置文件的例子,定义了关于文件包含、OBJ文件包含、单元文件搜索路径信息,并改变了编译器指令$O和$R的默认值。
-IC:\DELPHI\INC;C:\DELPHI\SRC
-OC:\DELPHI\ASM
-UC:\DELPHI\UNITS
-$R+
-$O-
Now, if you type:
现在,如果你输入:
dcc32 MYSTUFF
the compiler performs as if you had typed the following:
编译器把它当作你输入如下命令:
dcc32 -IC:\DELPHI\INC;C:\DELPHI\SRC -OC:\DELPHI\ASM -UC:\DELPHI\UNITS -$R+ -$O- MYSTUFF
Debug options
调试选项
The compiler has two sets of command-line options that enable you to generate external debugging information: the map file options and the debug info options.
编译器有两个命令行参数可以生成外部调试信息:MAP文件选项和调试信息选项。
Map file (-G) options
Map文件(-G)选项
The -G option instructs the command-line compiler to generate a .map file that shows the layout of the executable file. Unlike the binary format of executable and .dcu files, a .map file is a legible text file that can be output on a printer or loaded into the editor. The -G option must be followed by the letter S, P, or D to indicate the desired level of information in the .map file. A .MAP file is divided into three sections:
选项-G指示命令行编译器生成一个.map文件来查看一个可执行文件的布局。不同于可二进制的可执行文件和.dcu文件,.map文件是一个可读的文本文件,可以被打印或是其它文本编辑器编辑。选项-G后必须跟字符S、P或D,去决定你想要在.map文件列出的信息。一个.MAP文件被分成三个节:
Segment
Publics
Line Numbers
-GS outputs only the Segment section, -GP outputs the Segment and Publics section, and -GD outputs all three sections. -GD also generates a .DRC file that contains tables of all string constants declared using the resourcestring keyword.
-GS选项只输出Segment Section,-GS选项输出Segment和Publics,-GD输出所有的三个Sections.-GD选项也生成一个扩展名为.DRC的文件包含所有的用resourcestring关键字声明的字符串常量。
For moles (program and units) compiled in the {$D+,L+} state (the default), the Publics section shows all global variables, proceres, and functions, and the Line Numbers section shows line numbers for all proceres and functions in the mole. In the {$D+,L-} state, only symbols defined in a unit's interface part are listed in the Publics section. For moles compiled in the {$D-} state, there are no entries in the Line Numbers section.
用默认的编译选项{$D+,L+}编译模块(程序或单元),Publics Section列举所有的全局变量、过程和函数,Line Numbers Section列举模块中所有的过程和函数的行号。如果用{$D+,L-}编译选项编译模块,Publics Section中仅列举在单元的interface部分定义的符号。如果用{$D-}选项编译模块,在Line Numbers Section没有任何入口。
Debug info (-V) options
调度选项(-V)
The -V options (-V, -VN. and -VR), which cause the compiler to generate debug information, can be combined on the command line.
选项-V、-VN、-VR会指示编译器生成调试信息,它们能在命令行中组合使用。
Generate Turbo Debugger debug info (-V) option
生成Turbo Debugger使用的调试信息的选项(-V)
When you specify the -V option on the command line, the compiler appends Turbo Debugger 5.0-compatible external debug information at the end of the executable file. Turbo Debugger includes both source- and machine-level debugging and powerful breakpoints.
当你在命令行中使用-V选项时,编译器会在可执行文件的末尾附加与Turbo Debugger5.0一致的外部调试信息。Turbo Debugger包含代码和硬件级别的强大的断点。
Even though the debug information generated by -V makes the resulting executable file larger, it does not affect the actual code in the executable, and does not require additional memory to run the program.
虽然附加调试信息到查执行文件中会使可执行文件增大,但是它并不影响实际可执行文件中的可执行代码,也不需要额外的内存来启动程序。
The extent of debug information appended to the executable file depends on the setting of the $D and $L compiler directives in each of the moles (program and units) that make up the application. For moles compiled in the {$D+,L+} state, which is the default, all constant, variable, type, procere, and function symbols are known to the debugger. In the {$D+,L-} state, only symbols defined in a unit's interface section are known to the debugger. In the {$D-} state, no line-number records are generated, so the debugger cannot display source lines whe