Delphi 7 抱怨找不到文件
我已经修改了一个 BPG 文件,将其用作我们公司自动构建服务器的 make 文件。 为了让它工作,我必须更改
Uses * Uses unit1 in 'unit1.pas' * unit1 unit2 in 'unit2.pas' * unit2 ... * ...
DPR 文件以使其工作,而编译器不会给我一些关于未找到 unit1.pas 的废话。 这很烦人,因为我想使用 BPG 文件来实际查看项目中的内容,每次添加新单元时,它都会自动将“unitx.pas”中的内容插入到我的 DPR 文件中。
我正在运行 make -f [then some options],我正在编译的 DPR 与 make 文件不在同一目录中,但我不确定这是否重要。 只要删除 'unit1.pas 中的 ,一切都可以正常编译。
I've got a BPG file that I've modified to use as a make file for our company's automated build server. In order to get it to work I had to change
Uses * Uses unit1 in 'unit1.pas' * unit1 unit2 in 'unit2.pas' * unit2 ... * ...
in the DPR file to get it to work without the compiler giving me some guff about unit1.pas not found.
This is annoying because I want to use a BPG file to actually see the stuff in my project and every time I add a new unit, it auto-jacks that in 'unitx.pas' into my DPR file.
I'm running make -f [then some options]
, the DPR's that I'm compiling are not in the same directory as the make file, but I'm not certain that this matters. Everything compiles fine as long as the in 'unit1.pas
is removed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能是因为IDE中的搜索路径和命令行编译器的搜索路径不相同。 如果更改命令行编译器的搜索路径,您可能能够使用与 IDE 中完全相同的源代码。
配置命令行编译器的搜索路径的一种可能性是在名为 dcc32.cfg 的文件中进行配置。 看一下帮助,IDE帮助中有关于dcc32.cfg的简短描述。
It could come from the fact, that the search path in the IDE and the search path of the command line compiler are not the same. If you change the serach path of the command line compiler you might be able to use the exactely same source code as within the IDE.
One possibility to configure the search path for the command-line compiler is to do it in a file called dcc32.cfg. Take a look at the help, there is a short description of dcc32.cfg in the IDE-help.
嗯,这个解决方法对我有用。
唯一的问题是,每当您添加新单元时,delphi 都会删除顶部的
ifdef 包
。Well this work-around worked for me.
The only problem is whenever you add a new unit, delphi erases your
ifdef package
at the top.每次我必须将条件放入项目文件中时,我都会这样做:
也许这个技巧也适用于包。 从未尝试过。
Every time I have to put conditionals into a project file I do this:
Maybe this trick works in packages too. Never tried.