How can I write a C program in the IDE, cloud9? Whenever I start to write its showing errors, I even tried to change the file extension to ".C", but it doesn't work.
Does the cloud9 IDE support C programming?
Short answer
Yes Cloud9 does support C and C++ programming
Long Answer
Cloud9 has a varying level of support for different programming languages and frameworks.
Cloud9's ACE editor currently supports highlighting for about 60 programming languages including C/C++. The list is growing and you can get the full list from the "View -> Syntax" menu.
The editor has extensive support for JavaScript with error highlighting and code completion. It also has live syntax error checks for CSS, CoffeeScript, PHP, Python, JSON and Lua.
The run menu supports running
JavaScript (node.js)
Python
Ruby
PHP (using apache)
Each project is a unix sandbox with the standard tools like bash, make, gcc, vim, java SDK or perl installed. The terminal in Cloud9 is a full xterm compatible terminal emulator and you can use this to compile and run your C programs.
Cloud9 also has a package manager called c9pm which currently has about 120 packages. These packages include e.g. different versions of python and ruby, mono, lua or groovy.
In case you still need additional tools or libraries you can always download them to your workspace and compile and install them there.
As you see it is hard to draw the line of what is actually supported but usually you will have at least syntax highlighting in the editor and running from the console.
It claims support on the web page for "Javascript and Node.js applications as well as HTML, CSS, PHP, Java, Ruby and 23 other languages".
Yet it's very light on regarding details of those other languages. It does state that the editor, ACE, supports many different languages although whether that's natural languages or computer languages it doesn't specify. Additionally, an editor supporting a language is not the same as an IDE supporting it. It makes little sense having syntax coloring for C but no compiler.
Certainly C++ is possible as shown here but the fact that you simply use the editor then switch to a terminal session to compile the code seems to reduce the attractiveness of the so-called "IDE". It doesn't seem to give you anything you can't get from vim/gcc under Linux, or MinGW under Windows. It certainly isn't integrated in the sense that Visual Studio (even Express) or Code::Blocks is.
Regardless, the proper place for this sort of query is most likely on their support page here. I suspect they'd know more about what's supported than anyone here on SO.
Though I wouldn't be hopeful for a response. There's a very similar question asked back on Feb 28 which has still had no response. You have to wonder whether you want to entrust your precious code to a company that takes over four months to answer a simple support query.
In fact, to be brutally honest, I'm not sure I see the value proposition in using such a service. Given that you can get very good local IDEs already (for zero cost), the only possible advantage that springs to mind is collaboration. And, if you're working in a shop that has geographically dispersed developers, they'd probably have a fit if you told them you wanted to store your code where someone outside the company can get at it :-)
I'm not trying to turn you off the idea, just stating that (based on my experience), it doesn't seem as good as a substantial number of other solutions.
Cloud 9 does support C ( and C++ ) using gcc and g++
gcc --version
(GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
You can use their integrated editor, but the run button still acts like it trying to execute Javascript, which is the default, and seems to be their the target audience.
They have a fine C hello world example -- http://support.cloud9ide.com/entries/23541348-C-hello-Cloud9
Typically I just maximize the terminal, and run vim ( they have 7.2 installed ), and it works just like any passable unix terminal. They also have gdb installed, if you need a debugger.
There are comparisons against installed compiler solutions, but that isn't what Cloud9 is competing against. Their own description is Google Docs for code, and that seems to pretty fairly accurate. It certainly isn't all things to all people, but it is a pretty amazing service.
With Cloud9 I can write code on my Chromebook without having to install a bunch of stuff to almost make Linux run on it. This would be a good solution for students, since it would allow them to work in a computer lab without needing any software installed. I have found that using github and c9, I can easily switch back and forth between c9 while I am remote, and a local setup when I am on a real computer.
Related
Short version of question: How do I get started with C programming? Note that I am not asking for a tutorial on learning C language (I can learn that easy enough). I need to setup the environment (I hope I'm asking this question clearly). Here's what I mean:
For my math thesis, I need to write a program in C on Gentoo Linux, using a library called CVODE/SUNDIALS. There is nobody (it seems) in my department who can help me set this up - my professor has left the computer work 100% to me because I have some programming background and he's a math geek. But my experience is with scripting languages (think VBA) and not full, powerful programming languages where you have to link the compiler and libraries, etc. like C.
There is no development environment on the Linux cluster - or at least not that's friendly, and has a debugger - that I've found. So, what I need to figure out how to setup a C programming environment with CVODE library on my PC (Win 7 x64, at little to no cost.
I have found plenty of tutorials on programming in C. I looked up Eclipse, which I have a little bit of experience with, as a development environment, but it's instructions say you need to install a compiler, too.
What I would like is someone to tell me, in simple language that I can understand (which might be the most difficult part of this question) the big picture of what I need and what to do (and maybe even links to where I can find what I need) to set up a C environment with CVODE. If the information is Windows/Gentoo Linux cross platform, even better.
Thank you.
P.S. I did search the site and saw lots of "How do I setup" quesitons, but no C one. Because I know someone will yell at me for that. Also, I don't want to have a convo about whether to use C#, C++, Java, etc. That just complicates the issue - and I need to get this done.
Edit: I have learned a little more since this question and now realize that I left out a key part of the question. The CVODE library and Linux cluster at school use MPI - parallel programming - which is not available on your average, run-of-the-mill PC. So all development must be done directly on the cluster.
Linux: Simple way is to install gcc or g++.
You can write your code in your plain text editor (nano, vim, gedit, kwrite, etc)
Save your file in .c or .cpp extention and type in terminal
gcc filename.c
or
g++ filename.cpp
You said that you want to write c code on Gentoo Linux, as i understand you're not familiar with Linux? The best choice in this case is to:
Install virtualbox in your windows machine (https://www.virtualbox.org/), it's a free software that let you emulate in your desktop another systems like Linux...
Install Gentoo linux on virtualbox, there are a lot of tutorials on the net, for example this video: http://www.youtube.com/watch?v=DUf_1wAPeyA
When you install Gentoo Linux on virtualbox you have all you need to develop C (gcc compiler, gdb debugger...)
Now you can download your library, and decompress it
In general all (Good) Linux libraries come with a 'README' file that contain all instructions for installing the library.
I think you need to do this:
./configure --prefix=/DIRECTORY_YOU_WANT_TO_INSTALL_THE_LIBRARY
make
make install
You can now play with C and you new library, like this:
suppose you create a new file test_lib_ CVODE.c you can compile it like this:
gcc -Wall test_lib_ CVODE.c -o test_lib_ CVODE -lcvode
I assume that the installed library is named libcvode.so
If you have any questions, you can always get help here.
Regards.
I think you should use Code::Block in Linux, it is very similar to Window's Code::Block and it is very easy to debug and other things.
These were all useful answers. I tried pursuing each of them at least a little bit. However, the only reasonable solution seems to be to use emacs on a terminal window. This is because I'm using MPI - yes, I know I didn't mention that in the OP - which can only be done on a cluster.
I am new to this environment and was not aware of the MPI or the affect it would have on my attempt to develop.
I believe I can do better than this if I can figure out X/Windows using Cygwin. But I am a long way from that.
Thanks all for your effort and sorry I can't really award a best answer (I guess).
I am looking for something similar to the JavaScript linting tools JSHint or JSLint for C. My text editor (Sublime Text 2) has a JSHint pluggin that gives me real time feedback to my JavaScript code.
What is the best way to get feedback about the quality of my C code? Are there any tools that could give me real time linting?
I've concocted a way to drop some user-made linters written for SublimeText 2 into the mix to get the linting working with SublimeLinter and ANSI C. Also note, this is a slightly 'hacky' way of getting it to work.
You must have clang installed (for OS X you can use Apple's command line tools to install clang/the LLVM compiler, which requires only a developer account, which is free), you also must have SublimeLinter installed in Sublime Text 2
Navigate to this user's fork of SublimeLinter and proceed to download the 'c.py' module from the modules folder
Copy this module into SublimeLinter's working modules directory located under **your SublimeText 2 data directory**\Packages\SublimeLinter\sublimelinter\modules\ (see this for further information on the data directory)
Restart Sublime Text 2†
†Be sure that the current language in the lower right-hand corner of the window is set to 'C', not 'C++', 'Python', ect.
Take a look at the Clang Static Analyzer and Gimpel's PC-lint and FlexeLint
Also, please have a look at cppcheck
Since this question was asked and answered, there are now some options for C/C++ linting in Sublime that are a bit more user friendly than the accepted answer. All of these are plugins for SublimeLinter. I recommend using Package Control as a package manager for Sublime Text (as do the plugin authors).
First, install Sublime Linter if you don't already have it (it's a pretty popular linting framework for multiple languages). It is most easily installed through package control, as the authors recommend, but more info is on the github site. Once Sublime Linter is installed, there are two to four different accessory packages that now exist for linting C and C++ code.
Two of these use the C/C++ compiler itself for checking; these are SublimeLinter-gcc and SublimeLinter-clang. Both can be installed via Package Control, and provide SublimeLinter with an interface to the relevant underlying compiler. The gcc package makes it easy to specify which compiler executable you want to use, in case you might want to check code for cross-compilation.
The other two are interfaces to cpplint and cppcheck, respectively. These two are also available on Package Control, and despite the names it seems that both will lint C and C++ code.
Note that you probably only want one of these options enabled at a time, although the SublimeLinter setup allows you to have multiple options installed and only one enabled via the "linters": {...} option stanza.
Passing it through your compiler with full warnings is a pretty good basic lint. It will catch things like typoed variables and such. clang with optimizations off is fast enough to use as the basis of a real-time plugin, but I'm not aware of such for sublime text.
You have enough rep that I feel this might be too obvious of a suggestion, but it sounds like you would basically benefit from an IDE? e.g., Eclipse. I dev in Eclipse/Java and it's pretty aggressive regarding errors/warnings, certainly more than I've seen a compiler be.
I am getting interested in the Oberon language and I would like to know: is the language actually used by common programmers or is it still only used by researchers? Is it production-ready? What I have in mind are non-scientific applications requiring GUI support and possibly Internet connectivity (at least client-side POP3 and SMTP functionality).
Also, which of the Oberon flavors would you recommend for my needs (Oberon2, Active Oberon, etc)? The simpler, the better, as long as it is well maintained and has some community.
If possible, I would like to run my applications in a conventional host environment (Windows or Linux), without the need for a special runtime environment or a special operating system.
Thanks
BlackBox has some of what you want, runs on flavors of Windows.
There are also some environments that compile to Java bytecode and target the JVM.
Look at POW, and Gardens Point Component Pascal.
I happen to be using some command-line only tools that are Oberon Compilers.
OO2C is an Oberon to C compiler (but the output is not for human consumption).
Ofront is an Oberon to Human-Readable C, but I haven't yet set up a linux box to run it on. (otherwise, it is supposed to run inside of BlackBox on Windows).
There is also Oxford Oberon Compiler by Professor Spivey. A VERY enjoyable Compiler that compiles to a Virtual Machine, but the whole object code is a self-contained application (albeit command -line).
It is a VERY small download, meant for an educational environment, keeps everything CLEAN, and works well for prototyping some of the grunt work or procedures/modules of your code. It also is supposed to allow bitmap drawing in XWindows in Black and White only, probably for drawing graphs, etc, but I have not had an opportunity to use that feature yet.
It has a GUI-based debugger, profiling, and some other interesting tools, and still is very small by comparison to most modern compilers like gcc. It is also totally stand alone.
Works on Mac, Win, Linux, and has source.
By comparison, OO2C took me about a day of futzing and compiling to get it going (but it is working).
I don't have a Windows box right now, so I can't run my copy of BlackBox, but it had a full GUI, and lots of Source code available at the Component Pascal Collection website.
http://www.zinnamturm.eu/index.htm
If you are looking for source code you should also check out that site in hopes you don't have to reinvent the wheel.
Really a joy to step into Oberon after having to fight C/C++ all day long to get simple stuff done.
OBNC is a new compiler for the latest version (2016) of the original Oberon language by Niklaus Wirth. It compiles via C and makes it easy to interface to existing C libraries.
https://miasap.se/obnc/
Given that Oberon [language] was developed as a complete [operating-]system, and that ETH's CS department ran ALL its computers (even the secretary's) on it I should think it is application-ready. This according to the following PDF:
http://www.ics.uci.edu/~franz/Site/pubs-pdf/BC03.pdf
is the language actually used by common programmers or is it still only used by researchers?
There was/is little use of the original Oberon language outside academia; there was some industrial adaptation of Oberon dialects like e.g. Component Pascal.
Is it production-ready?
Depends on your requirements. Given todays expectations of software developers the (original) language and available toolchains seem very minimalistic.
non-scientific applications requiring GUI support and possibly Internet connectivity ... in a conventional host environment... which of the Oberon flavors would you recommend for my needs?
GUI support and network programming in a conventional host environment is e.g. supported by https://blackboxframework.org as already mentioned, which uses a language related to Oberon.
You could also have a look at https://github.com/rochus-keller/Oberon which includes a platform independend IDE with semantic navigation and a source-level debugger, plus a platform independent foreign function interface as a language extension which allows you to directly use any C shared library, and thus reuse the plethora of existing proven GUI or network libraries out there without having to program in C. It also offers a modern, lean syntax variant without all the semicolons and capitalized keywords, which should appeal especially to younger developers; but of course also the traditional syntax is supported, even mixed modern/traditional syntax projects.
I want to learn C language (is this something good ?) and i didn't know from where i can download the language to my PC ?
and are this FREE or must pay for ?
Is C a good language? Definitely. Is it the best first language? Depends.
If you are using Windows, you can download Visual C++ 2008 Express Edition SP1 from Microsoft for free.
On Ubuntu, just run
sudo apt-get install build-essential
On Mac OS X, install Xcode from Snow Leopard/Leopard DVD (or download the latest version from Apple developer Web site)
There are quite a few free C compilers for the PC.
As seen above, MS Visual Studio comes in a free version.
However, most introductory C programming materials will work best in a unix-like environment. Two options for such an environment are:
Cygwin, which provides a unix-like environment that can be installed over a windows system.
MinGW32/MSYS, which natively ports GCC and some unix-like development tooling onto Windows, allowing you to use GCC to build native Win32 apps.
For learning you might be better off running a native unix/linux environment. If you already have Windows and don't want to uninstall or dual-boot you can run this under a VM. Several free hypervisors are available that will let you do this.
If you want to use a different development environment you could try Eclipse.
Just go to this link and look for Eclipse IDE for C/C++ Developers (79 MB).
http://www.eclipse.org/downloads/
There is a free compiler called gcc that will compile C code. On Mac OS X and Linux you probably already have it, try typing gcc at a command prompt.
On Windows, you can still use gcc, but you need to use either Cygwin or Mingw.
Or if you want to use an IDE and Microsoft's C compiler you can get a free version of Visual Studio here.
You can use Dev C++ . Very decent tool for beginners and intermediates.
OK (all free):
For Windows
- there is Visual C++ Express
- MinGW (and is command-line based)
You will need the MS Platform SDK as well.
Linux/Sun
- GCC (there are a number of ways to get this distro depending)
OS X
- Apple's Developer Tools (Xcode and others)
It is definitely free to learn and program C, but the answer to your first question "is this something good ?" depends on what your goals are. C is a very good language for some things, but not everything.
System programming is almost always done in C, along with network programs and some applications. C is also the basis for most modern programming languages you will work with, so learning the C syntax can be applied as you go about learning other things. However, if you are looking to make a interactive webpage, you might want to learn PHP. If you are looking to make a desktop application with a GUI, you might want to learn Java.
If you want to just get a start learning about programming, C can help you with that. If that's what you want to do, and dont care much about application right now, I suggest you go to the bookstore and just find a book on learning C for beginners. It should have a CD in the back with a compiler (probably visual studio), and should get you on your way.
This is a an excellent reference of free compilers for many systems.
http://www.thefreecountry.com/compilers/cpp.shtml
Intel provides free non-commercial compilers for Linux. The download includes the excellent Intel debugger & profiler. The free license can be summed up in two points:
My use of software products is for personal non-commercial purposes.
I understand that technical support will be provided by community self-help and user forums (via the Software Support link above), but cannot get committed support with a non-commercial license.
For the projects I work on, I personally prefer Intel Compilers over GNU... Intel seems to do a better job of optimization.
On Windows, I'll suggest Dev CPP. This is free an a very good product. It is also easier for the newbies to learn. I used it a lot. You can download the latest from
http://www.bloodshed.net/devcpp.html
If in Linux, there should be gcc. Use any editor of your choice( In my case vim). Just type vim filename.c in the terminal. This should bring the editor. press 'i' and write in the code. then press 'Esc' followed by ':' and x (This will save the file and exit the editor.
Now type gcc filename.c at the terminal. this should compile it. Now enter ./a.out to execute it.
If you wanted a "portable" compiler, Tiny C Compiler is a decent compiler that you can take with you on a USB stick - it's only a single .exe file or a single folder IIRC. It is cross platform as well, but the biggest downsides are that the warnings are lacking and that it's optimization isn't as good as the bigger compilers out there.
Nonetheless, it's a decent compiler to "play around with" if you don't want to install Visual Studio or Cygwin on Windows.
I think you need to be clear about the distinction between C and C++ before you decide what to do.
On Windows, try either Digital Mars C and C++ compilers or Open Watcom C and C++ products
About.com maintains a large list of c compilers for windows at http://cplus.about.com/od/glossary/a/compilers.htm
As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).
Question: Where shall start to understand how to compile a PythonCE module that will give additional functionality to Python on Windows mobile. Also, what is the required toolkit. Is it at all possible on Mac (Leopard)?
As the first step, you should try to create executable programs that invoke the functions you want. For example, to send SMS, it appears you need to call MailSwitchToAccount, passing "SMS", and so on - familiarize yourself with the C API on the platform.
To create executables, you need Visual Studio, and the Windows Mobile SDK. Those run on Windows. For cross-compilation, there is CeGCC (http://cegcc.sourceforge.net/docs/using.html), but using it probably makes things more complicated than using the Microsoft tools.
When you have executables that perform the functions you desire, creating Python extension modules out of them should be easy. Just follow the extending-and-embedding tutorials.
MSDN has plenty of samples for C++ development on Windows Mobile, and the SDK comes with several sample application. Unfortunately VS Express editions (the free ones) do not come with compilers for Smart Devices. The only free option is the older eMbedded Visual C++ (eVC), which is now something like 8 years old and not supported (though it can still create apps for devices at least up through CE 5.0).
just tried establishing an environment to get pythonce modules compiled (http://pythonce.sourceforge.net/Wikka/SConsBuild) but seems that I can only use 2003 PPC SDK and it has no recent functions available. Even when I followed all the steps in tutorial, sample spammodule.c does not compile :(
Is there any good tutorial I can utilize to startup C (C++) programming for Windows Mobile?
Also is it possible using free version of VisualStudio (Express version)?