Working comfortably in C using Eclipse

血红的双手。 提交于 2019-12-11 11:54:37

问题


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!


回答1:


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!




回答2:


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. ;-)




回答3:


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.



来源:https://stackoverflow.com/questions/4971083/working-comfortably-in-c-using-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!