BREW in Eclipse

Basic intro: BREW is a C API for programming cell phones. It is mainly for CDMA devices using Qualcomm chips. Basically, in the US it is used to program Verizon phones. All of the other (major) carriers use Java and J2ME.

Getting started with the BREW dev tools, the environment seemed really nasty to me, so I was going to try to swing something cleaner. They tell you to use Visual Studio, but all of their samples reference VS 6.0 although they have a tool set and one document for VS.NET 2003. Even that version, however, is outdate since VS 2005 is out. On top of that, VS is getting notoriously expensive (up to $10k/year per developer for some MSDN plans). So, in order to avoid this hell of versions and paying lots of money to MS, I ventured to get BREW stuff to compile under Eclipse using CDT.

CDT is a little out of place on Windows, you have to install Cygwin to get it working right. You should install Cygwin BEFORE CDT, otherwise bad things happen. The default “managed make” setup didn’t work for me, so I started writing makefiles like a normal person. I managed to get a build of the BREW app with GCC, but it would hang when I tried to run it in the BREW simulator. So, I switched to Microsoft’s compilers to see if it would work. After a bit of farkling, I was able to build the app with cl.exe and link.exe and run it in the emulator. For anyone that wants to avoid Visual Studio, you can now download the compilers for free (minus the IDE) from here:

http://msdn.microsoft.com/visualc/vctoolkit2003/

I believe those would be the VS.NET 2003 equivalents, so maybe they are a bit out of date, but they work fine. You may also need the platform SDK to get windows.h etc.

Now, I had a build that worked.

The next step was to actually do something. I’m a little rusty on my C and BREW uses some particularly nasty constructs, so I ran into a lot of segfaulting in my first run. Up until recently, I wasn’t much of a debugger person, but now I felt that I would need the debugger to get this BREW crap working in a timely manner.

CDT only supports GDB for debugging at this point. I was able to attach GDB to the brew simulator, but I could not seem to get debugging symbols loaded into GDB for my app’s DLL. Microsoft’s C compiler creates .PDB files which contain debugging information, which I don’t think GDB can understand. So, that was a no go. My next step is to try these tools to see if they
are usable without Visual Studio:

http://www.microsoft.com/whdc/devtools/debugging/default.mspx

We shall see…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s