PDA

View Full Version : How to code with CF3.5 on a Mac.


dapaua
28th July 2007, 07:33 PM
Hi, this is my first post. I've been all the afternoon trying to do this and at the end i got a C# "hello World" working, so i thought it would be nice to post how i did it with my mac. I've got a slow eMac with Mac OSx 10.4.9. You will need a Windows machine (or emulator) for one of the steps, maybe somebody knows how to get the files from the phone, but for me it was easier this way. The guide is for beginners, and maybe this info was widely known, but I couldn't find it. Enjoy it.
Step by step.
1- Download the compiler. I used the Dotgnu c# compiler, from here: http://pnetframework.sourceforge.net/ .
2- Install it, it installs to /Library/Frameworks/pnet.framework.
3- On windows, install The .net compact framework 3.5. After installing, go to:
c:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\Wind owsCE and get all the .dll files from here. Copy them to your mac. I copied it into a folder called pocketlib in my home directory.
4- Write a very simple test program:
----CUT HERE ---


using System;
using System.Windows.Forms;
public class HelloWorld

{
public static void Main()

{
MessageBox.Show("Hello World");
}
}

---CUT HERE ---
and save it as hello.cs
5- Compile it:

Now in the terminal type:

/Library/Frameworks/pnet.framework/Versions/0.7.4/bin/cscc -L~/pocketlib -lmscorlib -lSystem.Windows.Forms -nostdlib hello.cs


and rename a.out to hello.exe .
6- Transfer to the pocketpc device: transfer hello.exe to your pocketpc and it works.

That's it. I hope that i haven't forget anything ...

taguapire
29th July 2007, 07:31 AM
Hi,

Simple and Efficient. Is there a good IDE for C# under MAC???

Regards,

Taguapire.

dapaua
29th July 2007, 12:42 PM
I have not tried, but you can check monodevelop , which comes included with mono ( http://www.mono-project.com/Downloads ) .