C + GUI + Mac OS - c

i know c and I want to develop applications with GUI for Mac OS. Where do I start?

Learn Objective-C.
Then pick up Cocoa (and all of the Frameworks that go with it)

Buy Apple computer
Install XCode from supplied DVD
Run Software Update from system menu
Run XCode
Select Help menu, select "Developer Documentation"
Click on any of the many things that say things like "Quick Start" or "Getting Started with XCode".
Read
Program
GoTo 7.

Downloading xcode would be your first step. It's the main development environment for mac development and it's free. Then you'd want to get a book on Cocoa w/ Objective-C or Carbon w/ C. Apple is pushing Cocoa more.

The Simple DirectMedia Layer (SDL) library is yet another option. It is a cross-platform development library that can be used to write GUI-based applications for Mac OS in C.

While there is Carbon, it's a framework that's not first-class going forward. If you want to make sure that you can access all of the features of Mac OS X, you'll want to learn Objective-C and use Cocoa.

I believe all Macs nowadays come with a complete set of development tools. They're not pre-loaded on the Mac, but are in the CD-ROM or DVD-ROM package. Alternately, you can go to Apple's site and poke around until you find the development section, and download Xcode. (It'll be the same thing, but possibly a newer version.)
Mac OSX uses a language called Objective-C, which is C extended with OO abilities that are more like Smalltalk than the more usual Simula type (in C++, say). While you don't actually have to use it much, it is how you'll be writing interface code.
Further, it uses the Cocoa framework. There was a framework called Carbon, which was a cleanup and redesign of the pre-Mac OSX Macintosh system facilities, but it's being left behind.
You can find free information on either if you look, or you can buy books on them. Books are probably a better resource to learn from.

You can also try with QT and C++. Try here:
http://qt.nokia.com/products/platform/qt-for-mac

Related

What is the win32 equivalent for mac?

The below link shows examples on how the Windows API works:
Module 1. Your First Windows Program
I am quite interested in how the Mac API looks like.
After doing some reading, I read a lot of things like XCode (Environment), Cocoa Framework, etc. However, I dont see any information about something like the Win32 API.
Doesn't Apple have a low level C API that is not based on Obective-C but just plain old C?
Your link points to a tutorial for the GUI components of Windows. In that case, the equivalent for OS X is indeed the Cocoa framework, which consists of the Foundation and AppKit libraries, which are Objective-C libraries.
Cocoa's control drawing is entirely local to the application. Therefore, the only way to build applications using controls is with Objective-C. Nothing stops you from building a C API on top of that; similar tactics have been used to build libraries like Qt or bindings to languages like Python and Ruby.
There is no plain C GUI API in OS X. There are low-level APIs (part of the Quartz graphics framework, aka the Core Graphics API) for dealing with the window manager to open the top-level windows, but these are either very complicated or completely undocumented. And even then, you'd be responsible for doing all the controls and input handling yourself. Update Some of the basic facilities that applications build on top of are also available through C APIs, namely Core Foundation, Core Graphics, Core Text, and Grand Central Dispatch. But these are still not enough to use Cocoa; Cocoa is just built on top of them.
There is also the Carbon API, which is a C API, but was intended for transitioning pre-OS X applications to OS X and is thus not suitable for new application development. In fact, I'm not even sure it is even supported anymore.
So you have two options if you want to write a GUI program for OS X in plain C:
find a wrapper library
give up and learn Objective-C, which sits on top of plain C anyway
If online tutorials, including Apple's official ones, don't suit you, the Big Nerd Ranch books on Cocoa development are good. Note that their beginner-oriented books are transitioning to the Swift language, but they have a separate book dedicated to teaching Objective-C as well.
You'll also need to know that OS X applications almost exclusively design their user interfaces using a graphical designer called Interface Builder, akin to the form designers in Visual Studio. With the Windows API, you can still get away with doing things by code, and a lot of people do so; with OS X, doing everything programmatically is difficult (but still possible).

which development software should be used for VLC on mac?

i want to do some modification and development for VLC. i download its source code, vlc-1.1.5. and it is written by C. so usually which development environment should i use, xcode or some others?
thx...
I thought VLC was developed in Qt. Do you see the class names starting with Q? In case it is developed in Qt, Qt Creator or KDevelop would be a good choice of development environment.
The VideoLAN folks provide a wiki page with information about compiling their source on multiple platforms. The page relevant to OS X is here: http://wiki.videolan.org/OSXCompile
Compiling VLC media player on Mac OS X is different from normal linux compiling and OS X compiling. We do not use Xcode, but a simple ./configure and then make isn't enough either.
The page provides a step-by-step guide to setting up a machine running either OS X 10.5 or 10.6.
Any editor of choice should suffice. Looking at the code, it seems that VLC uses Unix-style building (autotools, make, etc). On Win32, it uses MinGW, so plain old gcc and make is probably used on OSX as well.

how to write a c program that runs on a mobile phone?

i wanna write a C program that runs on a mobile phone. Just for learning purpose. i think it's possible. but i dont know where to start with and the libraries that are available for it.
i have also planned to write a game that runs on a mobile phone.
help me to do it. thanks in advance.
I do not know a mobile platform where its SDK are reccomending using pure C anymore. Last that I knew of was the old Palm platform.
But you can write C/C++ with QT as GUI library for Maemo, MeeGo and possibly other Nokia devices. QT are object oriented, so its not procedural as you want.
I know of 1 platform where pure C is possible. That's the windows mobile version <6.5 using win32 api. But this is not a thing I personally recommend doing since C#.NET makes it easier to develop applications for that platform. I also think that pure C combined with XML/CSS using the WebOS PDK is possible but I might be wrong here.
If you have a wish to write for mobile devices using your knowledge in C then i would rather recommend to use languages like C++ and Objective-C where you also can write C and use C libraries.
A list of mobile devices and the programming languages used to develop applications for them:
Symbian - C/C++
iOS - Objective-C
Android - Java
Windows Mobile - C/C++/.NET
WebOS - C/C++
How about MoSync. It's OS-independent SDK. MoSync applications are written in the C and C++ programming languages.
Programming is almost same. Try downloading one of the SDKs and review the documents for any of the platforms you want.
1) iPhone
2) Android
3) Bada (This is Samsung's latest platform)
SDK comes with cross compilers , simulators and IDE to assist you.
Will add more to this.
Java-to-C compiler may work in J2ME case. You can try Clue: http://cluecc.sourceforge.net/

Using Eclipse for C programming?

I want to examine and modify some open source programs written in C.
Is it sensible to use Eclipse for this purpose? If so, what plugins should I add? What "gotchas" should I be aware of?
If not, what FOSS C IDEs do you recommend for coding C on a linux box? Emacs, while undeniably powerful, is not to my taste (I'm more a mouser than a keyboarder.)
I have found netbeans to be a better ide for C/C++ then eclipse -- C/C++ is a first class citizen in the netbeans world. I am personally using geany these days.
Use Eclipse CDT, you can download Eclipse IDE for C/C++ here . Its not as mature as the Java IDE, and it can be a pain to set up a proper build system with it unless you're happy letting Eclipse handle your builds.
As you asked for alternative open source IDEs, I would recommend Code::Blocks for anything C/C++.
If you want to give it a try, download a nightly build (they don't really keep the "stable" version up-to-date). You can find instructions for installing on Linux in the respective forum thread.
IMO Code::Blocks is really nice because it's fast, portable and you can configure every detail of your project easily. There are also lots of plugins that can help you with development.
But if you're accustomed to Eclipse and like it so far, you should really use CDT because you get the same (nice) look-and-feel as with the other Eclipse development environments (Java, Java EE, Jython, Python, ...).

Strict C Win GUI programming

Good day folks, I'm in a need of a bit of guidance.
Basically, I'm a webdev who knows some C from the past, but I've only developed somewhat simple console apps for *nix.
Shortly, I want to develop a simple Win program with a GUI and not get my hands into any of the following technologies:
.NET C#
Java
C++ (especially this one)
Because I have nor the time nor the need for it currently.
1). Can I use wxWidgets without resorting to cpp (if not, what other native looking and lightweight widget toolkit would you suggest?)
2). Can I use OpenCV with strict C? (no templates, inline functions, etc)
3). Should I look for other options for a compiler besides MinGW? Is Intel one worth investigating? (AFAIK, it has a restrictive license).
4). What IDE of the following would you suggest for windows / c programming
Dev-C++
Eclipse with appropriate plugins (can't remember the exact one)
Any text editor + *.bat for compiling??
Thanks!
If you're interested in learning C-based Windows programming directly, and not using other intermediate tools:
There's a really good reference book by Charles Petzold called Programming Windows. It's definitely the way to get started. Absolutely everything is crystal clear, and you never need C++.
The Windows API, as a whole, is built for C programmers. All the fancy stuff like an actual application window is passed back as "HANDLE"s, which are more-or-less just pointers into the OS's object table. You as a programmer never have to deal with objects, just their HANDLEs.
Also, this particular book does a good job describing the Windows event-loop. If you're unfamiliar with it, it is described in generous detail.
Good luck!
For C Windows GUI programming the easiest thing is VC++ (any version since 6.0) and The Charles Petzold Programming Windows book.
The free Express version of the Microsoft compiler should work fine - I'm not sure if you'd have to download the Platform SDK or if it comes with one.
You can write Windows GUI programs in straight C. Download the Windows SDK and look at the "GENERIC" sample (I assume it's still in there). This is pretty much the minimal code required for a Win32 app, and it's in plain-ol' C.
Edit: Hmmm, it doesn't appear to be installed on this laptop. You can find it online here.
It might be worth reconsidering C#.NET. You could easily learn C# in a couple days, and be developing slick apps very quickly. Straight C-based windows libraries, particularly Win32, are BRUTAL in comparison. You'd spend a week just to write a simple app that would take minutes in C#.
The only C-based toolkit I can think of is the Windows port of GTK+. I have no experience using it in the Windows environment though. It is very mature on the Linux side though, and may be good enough if your needs are simple.
Learning the Win32 API is hard! But like others have stated, Petzold's book is the way to go if you insist on going down that path.
My opinion is that developing a Windows GUI using only C and the Win32 API would be harder to learn than picking up just enough C++ to utilize one of the C++-based frameworks. You could still do the majority of your work in plain C.
As for free IDEs, I would go with Visual Studio 2008 Express Edition.
You don't need anything.
Just use C and Win32 api , like real programmers, not kids..
See the VS Win32 wizard
Regarding wxWidgets, you can use https://sourceforge.net/projects/wxc
I never actually heavily used it, so I'm not aware of its maturity.
Mingw and Microsoft Visual C++ are my favorite compilers. Remember you can always use strict C and compile it using a C++ compiler, since valid C is almost always valid C++.
For windows, I've used Dev-C++ in the past, but nowadays Microsoft Visual C++ seems a better solution.
If you're going for text editor+bat, check out Notepad++.
EDIT: Just to clarify, using Microsoft Visual C++ does NOT mean learning C++. You can use C in it perfectly because - I repeat - valid C is often valid C++. Don't want C++? No problem. Just stay away from the C++-only features and you're still safe in a C++ compiler.
EDIT: Roger Lipscombe has noted in the comments that a pure C compiler is available in Microsoft's Visual C, using the /TC switch.

Resources