views:

601

answers:

6

Howdy Ya'll,

I'm a long time Windows developer, and it looks like I'm going to be involved in porting a Windows app to the Mac.

We've decided to use Flex/Air for the gui for both sides, which looks really slick BTW.

My Windows application has a C++ DLL that controls network adapters (wired and wireless). This is written using the standard library and Boost, so most of it should work cross platform.

On the Mac, what IDE/complier do most folks use if they want to write C++? Also, can someone provide a pointer to whatever APIs the Mac has that can control WiFi adapters (associate, scan, disconnect, etc)?

+3  A: 

The de-facto OS X IDE and compiler is xCode. It comes with every Mac, you just install it from the OS X install CD.

http://developer.apple.com/mac/ is the place to get more information on OS X APIs

amdfan
A: 

xCode and a custom GCC I believe...

chills42
Nothing special about gcc. You can build it yourself if you want!
Martin York
It's GPL, so naturally open source, but Apple does make OS X specific modifications. See also http://developer.apple.com/tools/gcc_overview.html
Pieter
A: 

XCode is used a lot, as far as I know the combination editor (e.g. Textmate), command line gcc is in fairly heavy use too. (that's what I do on OS X)

For all API needs head to http://developer.apple.com e.g. the networking API's

Pieter
A: 

xcode is the hotness, as people have already pointed out.

Having maintained a windows/mac codebase in the past, take a look at MVC:

http://en.wikipedia.org/wiki/Model_view_controller

So long as you keep the background logic distinct from the UI and from the platform-specific stuff (like file handling, networks, drawing to the screen, etc). That way, when you want to go to Linux in the future, you just have to write those platform specific components.

As for mac networking, are you on the level of connecting and so forth? Why not just let the OS handle that, and then you just see what connections are available? Why bother with whether or not the connection is wired or wireless? Because the OS has a lot of those tools already built in and users are used to making sure that the connection is there to do work, it seems odd to have an extra program to want to manipulate the network.

mmr
"Why not just let the OS handle that..." - The dll I'm porting needs to be able to enable and disable wired adapters, and for wifi adapters needs to scan ssid's and command the nic to associate with a particular wifi access point using the correct security setting (wpa, wep, etc).
Jim In Texas
+5  A: 

Xcode is the IDE for Mac OS X, you can download the latest version by joining the Apple Developer Connection with a free Online membership.

I don't believe there are any supported APIs for controlling wireless networking adaptors. The closest thing would be the System Configuration framework, but I don't know if it will let you do everything you want.

Also, I would strongly recommend against trying to use Flex/Air for your application's user experience. It may look slick to you on Windows as a Windows developer, but when it comes to providing a full Macintosh user experience such technologies aren't always a great choice.

For one example, I think Air applications don't support the full range of Mac OS X text editing keystrokes. While not all Mac users will use all keystrokes, for those people used to them trying to type in a text field that doesn't handle (say) control-A and control-E to go to the beginning and end of field is like swimming through syrup.

For a new application that needs to be cross-platform, I'd strongly consider building the core logic in C++ while using Cocoa on the Mac and WPF on Windows to get the best user experience on each platform. Both Mac OS X and Windows have modern native user experience technologies that their respective users are getting used to, and also have good ways for C++ code to interoperate with these technologies.

Chris Hanson
+1 for the comment about native interfaces. While Flex is very cool, part of the Mac experience is always seeing and using very well done Cocoa interfaces. As such they might try using Qt4 then since it supports native widgets on a variety of platforms.
Thanks for the insightful comments. We do have our core logic in c++ modules, and we did look at separate windows and mac guis. We couldn't find a good Cocoa dev here in Austin, plus we don't want to maintain two guis, so we're going to live with flex's limitations.
Jim In Texas
This is the best answer. It turns out that the Mac's latest System Configuration api will drive the wifi adapters the way we want. For earlier versions of their OS we'll have to use a utility program for controlling the wifi adapter.
Jim In Texas
+1  A: 

by the way for the uninformed, it's "Xcode" not "xCode". Sorry for being pedantic :/

Brock Woolf