编译时我在 free pascal 中遇到此错误(致命:找不到 ex2 使用的单元 crt)
我一直在研究帕斯卡语言,因为它在我的高中教学大纲中。我一直在写一些代码来看看它是如何工作的。到目前为止(一个多月)我没有收到任何错误,除了我自己的语法错误(这是我在 Free Pascal 中编码时),因为我做得很好,所以我想到更高级并开始编码(今天)使用 Sublime Text 编辑器并在 Free Pascal 中编译代码。但似乎弹出错误消息。
可能是什么原因?希望得到您的帮助!
I have been working on pascal language as it is in my high school syllabus. I have been doing some coding to see how it works. so far (for more than a month) I didn't get any error's except for my own syntax errors (this was when I was coding in Free Pascal),since I was doig pretty well I thought of going more advanced and started coding (today) with Sublime Text editor and to compile the code in Free Pascal. But it seems that an error message is popping.
What could be the reason? would love to have your assistance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能是 Free Pascal 的配置错误或未配置。
Crt 是最低级别 RTL 之外的单元,虽然编译器通常可以猜测 RTL 位置,但它不会添加额外的行。
确保您的 fpc.cfg 设置正确并包含类似内容
And that Sumlime does not call FPC with -n (以忽略配置文件)。
稍后补充:
好的。那是“fp”,文本模式 IDE,而不是 FPC 命令行编译器。文本模式 IDE 有自己的内置编译器(可以说是一个可靠的二进制文件),并且有自己的路径。将 -Fu 设置中带星号的路径输入到选项->目录->单元路径中。
如果您想要一个更加 21 世纪的 IDE,请考虑 Lazarus。
Probably it is a mis- or non-configuration of Free Pascal.
Crt is an unit outside of the lowest level RTL, and while the compiler can often guess the RTL location, it won't add additional rows.
Make sure your fpc.cfg is set up correctly and contains something like
And that Sumblime doesn't call FPC with -n (to ignore config file).
added later:
Ok. That is "fp", the textmode IDE, not FPC the commandline compiler. The textmode IDE has its own compiler builtin (one solid binary so to say), and has its own path. Enter the path with the asterisk from the -Fu settings into options->directories->unit path.
If you want a more 21st century IDE, consider Lazarus.