C++ IDE for Macs

I teach a C++ course using Visual Studio. One of my students has a Mac and was looking for an IDE to use on his machine. What would be good to recommend?

251517 次浏览

I cannot use a framework like jQuery. It needs to be in plain JavaScript.

Xcode is free and good, which is lucky because it's pretty much the only option on the Mac.

return img;

Just for the sake of completeness, I would suggest using the InnerHTML way as well - even though I would not call it the best way...

document.getElementById("image-holder").innerHTML = "<img src='image.png' alt='The Image' />";
}

Also be slightly wary of document.body.appendChild if the script may execute as the page is in the middle of loading. You can end up with the image in an unexpected place, or a weird JavaScript error on IE. If you need to be able to add it at load-time (but after the <body> element has started), you could try inserting it at the start of the body using body.insertBefore(body.firstChild).

To do this invisibly but still have the image actually load in all browsers, you could insert an absolutely-positioned-off-the-page <div> as the body's first child and put any tracking/preload images you don't want to be visible in there.

</script>

If an object implements IDisposable, you must call the .Dispose method when you're done.

</head> <body> <button onclick="createImage()">ok</button> <div id="res"></div> </body> </html>

Code::Blocks is cross-platform, using the wxWidgets library. It's the one I use.

Another (albeit non-free) option is to install VMware Fusion or Parallels Desktop on the Mac and run Windows with Visual Studio in a VM.

This works really pretty well. The downsides are:

  • it'll cost money for the virtual machine software and Windows (the school may have some academic licensing that may help here)
  • the Mac needs to be an x86 Mac with a fair bit of memory

The upside is that you and the student don't need to hassle with differences in the IDE that may not be accounted for in your instruction materials.

If you are looking for a full-fledged IDE like Visual Studio, I think Eclipse might be your best bet.

Eclipse is also highly extensible and configurable.

See here: http://www.eclipse.org/downloads/

Avoid Eclipse for C/C++ development for now on Mac OS X v10.6 (Snow Leopard). There are serious problems which make debugging problematic or nearly impossible on it currently due to GDB incompatibility problems and the like. See: Trouble debugging C++ using Eclipse Galileo on Mac.

It will eventually get cleaned up by the garbage collector, but it is always good practice to call Dispose. If you run FxCop on your code, it would flag it as a warning.