使用 Eclipse 在 C 语言中轻松工作

发布于 2024-10-17 08:59:20 字数 260 浏览 1 评论 0原文

嗯,我一直在使用 Eclipse 进行 Java 开发,现在尝试使用它来制作 C 应用程序。

问题是我对此感觉不太舒服。即:

  1. 我需要手动包含标题,即不是自动包含标题。
  2. 我从未见过可以解决任何问题的“快速解决方案”。
  3. 在编译之前我无法发现问题。

关于如何让自己感觉好一点有什么想法吗?

抱歉,如果我的问题相当愚蠢,但是从 Java 到 C 对我来说相当困难。

谢谢!

Umm, I've been using Eclipse for Java development and I am trying to use it now for making C apps.

The problem is that I don't feel too comfortable with it. Namely:

  1. I need to include headers by hand, i.e. not automatically.
  2. I've never seen a 'quickfix' to be available for any problem.
  3. I can't spot the problem before it has been compiled.

Any ideas on how I could make myself feel a bit better?

Sorry if my questions are rather stupid, but getting the way down from Java to C is rather hard on me.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

酸甜透明夹心 2024-10-24 08:59:20

是的,从 Java 到 C 有点困难,当我编程 C 时 Java 还不存在。

一些评论:

在 C 中自动包含头文件很困难
请参阅 #include headers in C/C++

您可以使用 lint 来捕获一些错误...
http://syncor.blogspot.com/ 2010/03/using-lint-in-eclipse-with-netburner.html

考虑使用 gTest 等工具进行 TDD,并自动化构建过程。
http://www.slideshare.net/amritayan/test-driven- development-in-c,可能会帮助您开发不同的节奏。

Eclipse 中的 gtest ... https://github.com/ospector/gtest-gbar

有乐趣!

Yeah its a little harder to go from Java to C, Java didn't exist when I was programming C.

Some comments:

Automatically including headers is difficult in C
See #include headers in C/C++

You could use lint to catch some errors...
http://syncor.blogspot.com/2010/03/using-lint-in-eclipse-with-netburner.html

Consider doing TDD using something like gTest, and automate your build process.
http://www.slideshare.net/amritayan/test-driven-development-in-c, might help you develop a different rhythm.

gtest in Eclipse ... https://github.com/ospector/gtest-gbar

Have fun!

你的背包 2024-10-24 08:59:20

在 Mac OS XCode 上是一个选项。

启动时:

New Application ->  Command Line Tool ->Type C

鲍勃是众所周知的(阿姨)。

您可以获得所有 XCode 快捷方式&在编辑器窗口中按 ESC 键完成代码。

嗯...我想我会开始实际使用它。 ;-)

On Mac OS XCode is an option.

On startup:

New Application ->  Command Line Tool ->Type C

And Bob is your proverbial (aunty).

You get all the XCode short cuts & hit ESC in your editor window for code completion.

Hmmm.... think I'll start using it actually. ;-)

囍孤女 2024-10-24 08:59:20

关于:

我无法在问题出现之前发现问题
已编译。

您可以获得有关语法错误的即时反馈。它们在左侧装订线中显示为问号,在错误下方显示为黄色波浪线。这会立即发生。确保在“窗口”->“首选项”->“常规”->“编辑器”->“文本编辑器”->“注释”下,选中了 C/C++ 索引器标记和 C/C++ 出现次数的“显示在”复选框。

re:

I can't spot the problem before it has
been compiled.

You can get immediate feedback on syntax errors. They show up as question marks in the left gutter and yellow squiggly lines under the error. This happens immediately. Make sure under Window->Preferences-General->Editors->Text Editors->Annotations that you have the "Show in" checkboxes checked for the C/C++ Indexer Markers and C/C++ Occurrences.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文