what is a good c compiler - iphone

i'm using windows xp what would be a good c compiler?
i want to learn c so that i can better understand the objective-c language for the iphone.
i have a great background in php so hopefully something will make sense
ps:
what sections should i put more focus on when learning c in getting prepared for objective-c?
thanks
Duplicate:
c compiler for windows
C/C++ Compiler for windows
Which C Compiler do you recommend for windows

GCC is a free, open source, high quality, compiler. You can get it with cygwin.
Microsoft makes a C compiler that comes with Visual Studio, which is Microsoft's integrated development environment. You can download the "Express" edition of Visual C++ to give it a try.
Also, Intel makes a good compiler.

The iphone uses the gcc compiler. This is available for windows using MinGW/MSYS or other compatibility packages.
Apple has Objective-C tutorials which assume very little C experience; I'd be tempted to just dive in. If you get stuck, then get K&R. (I don't know if php has types and pointers, otherwise you'll get stuck straight away)

Visual C++ express is free, has a really nice IDE and compiles C code.

I'd use gcc by downloading cygwin.

Gcc is the way, you can install mingw which is a native windows port.

I also recommend gcc, but don't get too used to GNU extensions such as asprintf() if you want to write portable code. On some systems, strdup() is lacking, amongst many others. The compiler itself won't spoil you, but glibc will.
On the one hand you have POSIX, on the other hand you have ISO/c89/c99, then you have gcc.
I highly recommend gcc, with the above warnings in mind while you continue to explore other compilers. For instance, it can be fun to code around the limits of Lestes if you enjoy dabbling in C++.
In any event, gcc is very powerful, boasts superior optimizations and can be so -pedantic that you think its out to get you. But, don't forget about portable code .. or where/if portability kludges are actually appropriate.
Cygwin is also highly recommended, as DasBoot posted.

You could have a look at this free e-book Programming in C in 7 days as a starter where they use Dev-CPP for windows
Note
It includes only the first 7 lessons of the more complete e-book “Quickly
Learn Programming in C”

Normally I would recommend Pelles C for programming C in windows. It is a good user friendly programming environment that has the best c99 compliance that i've seen... However, here I'm going to tell you that you should use gcc right off but not on windows. Use Linux (maybe Ubuntu?).
The reason I say to use gcc on Linux is because you want to develop for the iphone. I would suggest getting comfortable with the tools you are likely to use. I don't imagine you using the official iphone sdk (you'd need a Mac for that) so I think you'll be using the free tool chain. It does not compile on windows so switch to a supported platform and get comfortable with the tools.

I personally recommend MinGW. You can download it off SourceForge. It even works on a 64 bit configuration. I don't think it supports objective C. However, I found it useful while running C code on windows.
I don't have any idea about objective C and what parts of C you need to focus on while learning so as to make the transition easy. I'll leave that to someone with more experience.

gcc included in cygwin is a perfect first choice if you want to learn C on your Window XP platform. cygwin/gcc includes a basic Objective-C environment.
Anyway if you want to target iPhone, the best move would be to change to a Mac platform (which can natively run XP for smoothing the switch) in order to get Xcode, the Mac and iPhone development environment. You will also be able to learn CocoaTouch, the iPhone OS.
In parallel, you can register to the iPhone Dev Center for accessing all resources for learning iPhone programming.

If you're after a compiler that can compile both C and Objective-C, a GCC port to Windows is probably your best bet.

When learning C, concentrate on pointers, arrays, strings and memory management - those are the things that will trip you up coming from a managed environment of any kind.

The best thing about gcc is that it has a lot of features and supports the latest language standard. But for fast compilation and a nice programming environment you can't beat Lcc-Win32.

GCC is the cheapest compiler, Intel the fastest, MSVC the most featured.

Related

iOS - Will ASM code run on armv7/armv7s/arm64?

I'm trying to figure out if the ASM code for the function neon_asm_convert() in the example here will run on all armv7/armv7s/arm64 processors (ie., iPhone 4S/5/5S).
Unfortunately, I don't own all of these devices, so a simple run-test is out of the question.
However, I'm developing an app (testing it only using armv7) which uses the __asm__() from the neon_asm_convert(), and I would like to find out if the ASM code will also run on arm64.
I think I read that ASM code that runs on armv7/armv7s won't run on arm64 but I can't seem to find that reference anymore.
Does anyone have any pointers that cold help me out?
Looks like it's not going to run on arm64. As this answer says:
arm64 is a new ISA. The actual NEON instructions and register layout are entirely new. You will need to re-write or adapt assembly code for the new architecture.
As Tomer said, no. arm64 is a new architecture with a new instruction syntax and register layout.
However, fast implementations of this sort of colorspace conversion are available in the SDK as part of the Accelerate.framework. Except in special circumstances, you shouldn’t need to write your own assembly code for this. Specifically, you can use the vImageConvert_AnyToAny function, which provides high-performance implementations of this and many, many other common conversions that work on all of the architectures that Apple ships (armv7, armv7s, arm64, i386, x86_64).

C++ static library to be used in XCode

This is probably not a simple question so I am not looking for a definite answer but just some pointers to get me in the right direction.
I have absolutely no experience with C/C++ but have good knowledge of Objective-C. I also don't know much about different compilers and architectures so please be nice if I am talking stupid :)
I have some MatLab code that needs to be ported to Objective-C to run on an iPhone application. My first tentative path to get this done would be to check if MatLab can export the code as a static C/C++ library that I can call from within my Objective-C code.
This seems to be the case but I am not entirely sure what to do next, and what things I need to keep in mind when compiling the library on the MatLab side (i.e. architecture, compatibility, PC vs Mac, etc).
I have been provided with a .DLL and .LIB files which I believe are Windows compiled so they will not be useful for me, is this correct? From working with previous static libraries I can see they all have a .a extension - what do I need to do to get one that is compatible with the iPhone architecture?
And once I get the library compiled, how to I import and use it within my project? Will I just be able to call the public methods directly from within my code?
What else do I need to know or be aware of?
Any help is very much appreciated!
Thanks,
Rog
Static libraries contain binary code tailored for some specific operating system and platform. That means that it will use the OS to internally acquire memory (if it uses dynamic memory) or to perform any other OS specific operation (logging, output).
Even if the generated code was completely OS-agnostic (basic math could be implemented without OS support), the platform is completely different, matlab will generate code for an intel platform and the iPhone runs in an ARM architecture, with a different instruction set calling conventions...
Unless matlab is able to generate static libraries for the iPhone or at the very least for an ARM platform and make it OS-agnostic, you are out of luck.

Common LISP on iPhone/iOS

Is it possible to call a Common Lisp function in iOS?
If so, is it possible create it in a dynamic library?
It depends on what you mean by calling a CL function, but most likely ECL will be your shortest path. Start here, as there is a patch for ECL to better accommodate iOS: http://funcall.posterous.com/tag/iphone
ECL generates C code, so you should be in safe territory with Apple's shifting policies.
Have you tried MOCL?
According to the website "mocl is a highly optimizing CL implementation, delivering tight native code via LLVM/Clang".
Maybe you can create a dynamic library, though it is designed for use the other way around.
Clozure Common Lisp (CCL) runs in Linux on the ARM, and Gary Byers long ago made an experimental iPhone version, but it would only run on a jail-broken iPhone. The problem is that the CCL compiler writes executable code, but iOS out-of-the-box does not allow a writable page to be made executable, so you can't ever RUN that code.
We've had discussions about putting the code that ships with an iOS app be in a read-only code section, and adding a byte-code compiler, so that code created at run-time can be fairly quickly interpreted, but nobody has offered to fund that project, so it hasn't gotten done.
You might think that we could just interpret code created at run-time, but the current CCL "interpreter" compiles non-trivial code before executing it.
MOCL is probably your best option to write code callable from other apps, but that's only a guess, since I haven't used it.
You could use Gambit Scheme or Clozure Common Lisp, both are able to interface with Cocoa, the first because it generates C and the latter because there is a bridge from Clozure to Cocoa. Do a google search about it and you will find a few things.
You might want to keep an eye on this (new) project. It will be publicly available during October 2019: EQL5 iOS EQL5 iOS libs
There also exists Mobile Common Lisp1

Ada/Eclipse Integration

Are there any freely available Ada plugins eclipse. Eclipse is my main IDE and I occasionally need to read and modify some Ada, having it all in the one IDE would be ideal.
For Eclipse, AdaCore distributes and maintains the GNATBench plug-in, though I've never personally used it. I believe it is not GNAT specific, so it may still be of value even if you're using a different compiler--but I could be wrong on that :-)
If you're using the GNAT Ada compilation system, you've got a fully Ada-aware IDE in their GNAT Programming Studio (GPS), which is what I've been using ever since it finally stabilized a few years ago. It's got the jump-to-definition, get references, specialized search, etc., capabilities that you'd expect.
These, as well as the rest of AdaCore's GPL Ada development environment and tools, are available from AdaCore's Libre website. Download page is here.
If all you need is syntax highlighting, then maybe EclipseColorer will do the trick for you? It's a general-purpose extensible syntax highlighting engine that has definitions for Ada out of the box.
You may also want to check out Hibachi:
The goal of the Hibachi project is to create an Ada Integrated Development Environment (IDE) and tooling framework for the Eclipse platform.

Is Perl a good option for writing platform independent desktop applications?

Is Perl a good option for writing (possibly and partially) platform independent desktop applications? I know there are interesting widget libraries like GTK2 Perl and wxWidgets but I'm not familiar with development on Windows.
Is it possible to write a good application with Perl and those tools, maybe embedding everything needed to avoid asking the user to install external (and probably non conventional for many) libraries? Are there examples of this kind of apps around?
Sort of. You can certainly write Perl scripts that provide a Tk GUI that will work on any platform, and you can even package the libraries they need to work with PAR to put together an application that will run anywhere with an appropriate version of perl installed without requiring the end use to install a bunch of stuff from CPAN to get it to work.
However, an application that will run anywhere without requiring an existing perl installation (and it's probably not safe to assume the average Windows user will have perl) isn't really viable. One solution would be to distribute an "everywhere but Windows" version that simply uses PAR to include the necessary libraries, and a PAR::Packer-built version for Windows, which would be a fully-functional .exe including the perl interpreter and the libraries.
EDIT: following daotoad's response, it does appear that ActiveState's PerlApp can build cross-platform binaries for for Windows, Mac OS X, Linux, Solaris, and AIX; I haven't tried this but if it works as advertised it would seem to meet your requirements.
My employer uses ActiveState's PerlApp to produce executable versions of our apps with great success.
We tested PAR and PerlApp before selecting our packaging method. At that time, PerlApp had faster load times. Several versions of each tool have come and gone since then, so I would recommend testing with each before selecting a tool.
Executable packaging has been very effective for us.
There are a few portability issues issues with Perl, but if you pay attention to perlport, it's easy to avoid most issues. Our biggest problems are always with Win32. From time to time, some simple thing will require stupid, bizarre work-arounds or digging into Win32 API for a platform specific hack.
We have used both Wx and Tk guis.
Frozen Bubble is a well known and widely available app you can look at.
Check out PAR (available via CPAN) with respect to your bundling requirement.
Consider having a look at Padre for an example of a complex application written in perl using Wx.
So yes. All of your requirements are achievable, including portability.
I am working on the module XUL::Gui on CPAN, which uses Firefox to display cross platform gui apps from Perl. It is under development, but stable, and may be complete enough for your needs. You can build your gui in HTML and/or XUL (the Mozilla gui language that Firefox itself is written in), and then style everything with CSS. Let me know if you have any feature requests.