Starting with C using eclipse - c

I wanted to start programming with C, just because it is still important, and you need it for many study paths.
So i used eclipse before for programming java (just basics), and saw that you can use it for c/c++ too by installing other features. But I don't understand how to get it working, i tried several guides, but they were all outdated. I don't know how to link a compiler to eclipse, or whatelse I need.
ps: Sorry if my english may sound a little odd, I'm from germany.

please follow this link you can download
https://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/lunar

Related

Gtk on Dev C or C in general

I need to use gtk on Dev C++ and i have tried installing MSYS2 but there are only guides for other development enviroment like Code blocks.
I have followed this guide https://stackoverflow.com/questions/37737020/install-gtk-for-c-on-windows-10 to the "pacman -S mingw-w64-x86_64-toolchain" point.
What can i do from that point on to be able to use <gtk/gtk.h> libraries on DevC?
If i have taken a completely mistaken direction don't hesitate to tell me.
Thanks in advance
I have seen many people saying there are better ways to do it but i am interested in learning something about graphic interfaces and had a specific request from a professor to do this in C.

Working comfortably in C using Eclipse

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:
I need to include headers by hand, i.e. not automatically.
I've never seen a 'quickfix' to be available for any problem.
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!
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!
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. ;-)
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.

Recommended for learning C

What could some of you recommend for using when learning C and programming with C?
I have thought of the following options. (On OSX)
Aquamacs
TextMate and the Terminal
XCode
I want to learn more than just the IDE so that I grasp the concept as I will be learning about compilers etc.
I tried Aquamacs when learning Erlang but it was more of a hassle than I enjoyed.
Is there a lot extra to learn when using an Emacs environment?
What is most beneficial for understanding how things work. ( C )
Are there any other tools or possible options worth looking into?
Thanks
If what you want to learn is C Programming Language in Mac OS X I would go with XCode. It has a very good GDB integration, and its learning curve is smoother that EMACS' or just writing your own Makefiles.
If you want to learn about C, in my opinion, you should use the most basic editor available, compile using the terminal with gcc. And that's it.
Once you'll understand the language, picking one IDE over an other will be a no brainer.
But no IDE will really teach you anything about C.
There's also BBEdit on OSX. (I've used it briefly in the OS8 days.) As far as learning C goes, there are a number of books that you can try. I'd pop down to whatever chain bookstore is closest and browse the Programming section.
I'd also invest in a good algorithm book.
If you want to use Emacs as an IDE, you will need to write Makefile in order to be able to compile from within Emacs. Writing Makefile could help you understand the compiler options, object code, linking and such.
So to use Emacs as IDE for learning C, you should be using C-mode, know about M-x compile and using gdb under Emacs(M-x gdb). To look up man pages for library functions, M-x man and supply it (3 printf, for example to read the man page of C I/O function printf) the section number and function name.
I am not sure if using Emacs+Makefile this way is most beneficial in helping you teach how to compile, link, build etc, but it sure does help in learning those ideas.
If you're not comfortable using a more advanced editor like vim or emacs, then I would suggest using TextMate or something similar. This would let you concentrate on the code you're writing rather than struggling to learn how to use the editor.
Using a full blown IDE like XCode will also allow you to pretty much ignore the build system while you're still learning the language itself. Once you get comfortable with C, learning things like make or cmake would be less overwhelming.
Then after that, maybe you can go back to check out vim or emacs and see what a more complex editor can do for you, if anything.

Any Online compiler you know for C or other languages? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Any online C compiler that you know which can do the following:
Compile and execute the C programs online
File handling
System functions like exec(), system(), fork()
Or any compiler which does not need installation procedure (I mean that you can just copy paste a folder to run the compiler easily)
Note:Please do not propose Turbo C.I know some online compilers at codepad.org (gcc).
I was using codeide.com but its out of service now I think.
And as asked above online compiler will be a best advice that you can give for me.
My environment is Windows ... Thanks in advance.
Any advices on other Language compilers are also invited
Just install something like tcc. It's seriously not worth messing around with an online compiling site if you're going to be compiling files on any sort of regular basis.
Comeau has an online C/C++ compiler, but it's mainly to evaluate their compiler.
or cygwin
I'd rather recommend to install cygwin, you'll get an unix-like environment, with gcc. Then setting up a Makefile - or even just a shell script - to be able to compile is not a big deal.
You asked for other languages: Here's one for Lisp (not a compiler, but an interpreter)
Online Lisp interpreter in Flash
rextester
Maybe my answer is a bit late, but we have created an online compiler and IDE where you can run and create your files using just a browser.
At the moment we support a few languages (C, C++, ObjC, Java, Pascal, Fortran) and a simple file system, but we will enable many more features for better coding and debugging during the near future.
All the features offered at the moment are completely free and there is no registration needed (you can register though in order to keep your files online).
You can try our service here: www.sourcelair.com
DJGPP Public Access Cross-Compiler (C/C++, DOS32, based on GCC)
yet another online compiler:
http://cmpe150-1.cmpe.boun.edu.tr
It supports sytax highlight, indentation etc. I wrote it as a part of my MS thesis
PS: did not test fork command
We have another compiler for C and C++ here: http://www.codepad.org/
I have nothing for C. For other languages, this is a ruby interpreter. But honestly the best online development environment is the browser itself. Javascript is an advanced language. Combined with technologies like CSS and DHTML and frameworks like jQuery or Prototype you can build graphics applications. It is not hard to find debuggers (like Firebug) also.
Of course you can't interact with the file system. To overcome this you could write a plug-in for a browser (notably Firefox). There are many resources available for this and although it is not as straight forward as pure javascript, it is easier than most people believe.
For Python and Sage, try out http://live.codenode.org. It is also open source under the BSD license, so you can be download and run it from your own computer, more info is here: http://codenode.org
just a sudgestion.
I do not know why you do not want simply to install a compiler. However did you considered the possibility of using a portable one?
http://en.wikipedia.org/wiki/Portable_C_Compiler
best,
Ste
One of the better lists for C++ is isocpp Getting Started page. Unfortunately Cameau's seems to be disabled for now. LiveWorkspace has been in maintenance mode for a while and it is not clear when it is coming back, which is unfortunate since it has a simple interface and when it was working allowed you to switch between gcc, clang and intel very easily.
Of the ones that are left Coliru is the most powerful, you have a full command line available and you can save files and therefore uses multiple files in your project.
The isocpp list somehow is missing codepad which although rather primitive along with Coliru allows you to use boost.
Coliru, ideone and codepad all support many other languages as well. The list of languages supported by ideone and codepad is pretty large and is obvious on the main pages with Coliru you don't have a list but besides C and C++ it also supports python, perl and ruby.

Getting Started with C and Objective-C

I am eventually wanting to program in Objective-C to write programs for OS X and possibly the iPhone. I do not have any direct experience with C and I come from a web programming background. I am much more familiar with java syntax than C and Objective C.
I am just looking for suggestions on how to get started. It looks like I need to just start with C (I do not yet have a Mac computer powerful enough for programming, so it would be nice to start with C on the Windows platform anyway (information about programming environments would be helpful too, I am used to eclipse)). I am just looking for book recommendations, online tutorials or any other pointers to keep in mind. Keep in mind though that my end goal is to work with Objective-C, so is there anything I need to keep in mind when learning C, anything to watch out for, etc. Thanks for any input.
Update: The reason I am thinking I need to learn C first is that most of the tutorials that I have come across so far for Objective-C assume you already understand C syntax, which I do not fully. Are there better tutorials out there for me?
I don't entirely agree with unwind who says "C and Objective-C are different languages". Objective-C is a strict superset of C.
Of course he knows that - his point was that you don't need to completely master C before progressing onto Objective-C. I'll second that (and hopefully have clarified it).
But I do think it's worth getting some basics with C first, as most introductory texts on Objective-C will assume a basic knowledge.
I don't have any recommendations on that myself, but probably most internet based tutorials will be sufficient for that purpose (remember, you're not trying to master it at this stage). If you want to take it seriously, then "The C Programming Language" by K&R is the classic text.
When you you can do some basic hello world programs in C, and understand the type system, pointers and stuff - then pick up a copy of "Cocoa Programming for Mac OS X", by Aaron Hillegass. This is a book about Cocoa that covers Objective-C along the way, but it one of the best presented coverages of the language. It will assume you are coding on a Mac (it's in the context of Cocoa after all). You may be able to follow the pure language stuff using GCC on Windows, but I wouldn't recommend it.
If you're going to be working on a Mac eventually, then best to do it at this stage, IMHO. You say you don't have a Mac "powerful enough for programming", but anything that can run OS X would be fine to get your started.
If you know java, obj-c will be easy for you (java was influenced a lot by obj-c.) Apple has great documentation, you can start here. I don't think you need to learn C before learning obj-c (sorry Joel).
You can use obj-c on windows if you get gcc. Also check out cocotron:
The Cocotron is an open source project
which aims to implement a
cross-platform Objective-C API similar
to that described by Apple Inc.'s
Cocoa documentation. This includes the
AppKit, Foundation, Objective-C
runtime and support APIs such as
CoreGraphics and CoreFoundation.
With all the buzz about iPhone development, there are now dozens of obj-c books. Not sure how good they are, but a classic that I would suggest is Cocoa Programming from Mac OSX by Aaron Hillegass.
Programming in Objective-C by Stephen Kochan is what you want. It assumes no programming experience but doesn't hold you back if you do and introduces the whole thing, C with the Objective-C superset, as a complete package. I read the first half of Kochan (the second half gets into Cocoa) and now I'm working on Cocoa Programming for Mac OS X (3rd Edition) by Aaron Hillegass and reading Kochan was a massive help. Those two are a "one-two punch" that will get you going in no time.
Have a C and Objective-C reference handy as Apple's docs of C in XCode pretty much sucks from what I've seen so far. K&R's C text is like the Encyclopedia Brittanica of C and, just like a set of encyclopedias, isn't for everyone. I've just been Googling for references and generally find what I need on the web since C is so ubiquitous.
You'll burn through a couple of books before you find the set that best fits you, but you simply can't go wrong with Kochan and Hillegass for Objective-C and Cocoa. By the time you finiah the first couple chapters of Hillegass, you'll want to (and be able to) start writing some stuff on your own.
There is a recent blog-entry at Tuaw:
http://www.tuaw.com/2009/01/15/starting-out-with-objective-c/
4 guides about getting started with Objective-C, which helped me quite a lot when I started developing in Xcode. You should take a look at this:
http://cocoadevcentral.com/
http://developer.apple.com/iphone/index.action
http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/
http://developer.apple.com/iphone/library/documentation/userexperience/conceptual/mobilehig/Introduction/Introduction.html#//apple_ref/doc/uid/TP40006556-CH1-SW1
I'd say that it's better to learn C first. be sure to approach it like what it is: a structured machine language.
when you feel comfortable on it (no need to really master it), go on to Objective C, where you'll rediscover several things familiar from Java, but knowing the C infrastructure will make more apparent when they're similar but not equivalent.
it's very important not to learn a language using what you already know as a 'metaphor' for the new. always try to pretend you didn't know anything before.
I don't know what you mean by a Mac powerful enough to do programming on (any Mac should do), but get yourself something at least marginally useful as a development system soon. (You may well have the development system on one of the CDs that came with your Mac, or alternatively you can download it from Apple.)
The sooner you get Xcode working, the sooner you'll be comfortable with it.
I have recently started to learn programming for the Iphone and tried many differenet books until i found these helped me the most (I would also strongly recomenned getting a mac since the Xcode is the way to go when coding for Iphone):
Apress: Learn C on the Mac (To
get the initial C going)
Apress: Learn Objective-C on the Mac
(Learn Objective-C based on your
understanding of C)
Apress: Learn Cocoa for the mac
(learn apples way of building
applications, greatly helps when
going over to Iphone however you can
go straight to the iphone if you
like)
Apress: Beginning Iphone
development... (The final book,
and essential tool)
To note all these books have the same author and thus the traceability is great! The books have crossreferences between each other that really helps.
Agreeing with others, I found Cocoa Programming for Mac OSX - Hillegass
a great intro to Objective-C, the Cocoa framework and whole Apple way of doing things.
You can run Objective-C on any Linux or Windows box too although of course you won't have access to all the Apple libraries eg. NS (afaik). These frameworks are really the whole point of Objective-C, and the real reason it still exists given C++ and C# came later and are more or less languages designed around themselves (as opposed to Objective-C which is a strict superset of C).
Apart from pointers, I think you can get by without learning all the intricacies and close-to-the-metal aspects of C, although any and all C you can digest always helps.

Resources