Build Application For Macintosh

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Everyone,

I've been approached to develop an application that will run on Windows as
well as Apple Macintosh platforms. Being primarily a C/C++ programmer I would
prefer to use this language. I was hoping to use Visual C++ 2003 and build
the application for both platforms.

Is this possible? If so, what additional tools will I require?

Thanks heaps for any advice or direction
 
I've been approached to develop an application that will run on Windows as
well as Apple Macintosh platforms. Being primarily a C/C++ programmer I would
prefer to use this language. I was hoping to use Visual C++ 2003 and build
the application for both platforms.

Is this possible? If so, what additional tools will I require?

Back in MFC 4 days (I think), MS did have some support for building
MFC apps for the Mac. However, as far as I know, it's long been
abandoned. The best plan may be to isolate as much platform specific
code so your common C++ code is simply re-compiled for different
platforms, and if you want to try to keep common code for the UI
aspects, try a toolkit such as: http://www.wxwindows.org/

Dave
 
Back in MFC 4 days (I think), MS did have some support for building
MFC apps for the Mac. However, as far as I know, it's long been
abandoned. The best plan may be to isolate as much platform specific
code so your common C++ code is simply re-compiled for different
platforms, and if you want to try to keep common code for the UI
aspects, try a toolkit such as: http://www.wxwindows.org/

Dave

Thanks Dave for you prompt reply and also directing my towards wxWidgets. I
heard that a while ago MS released "Visual C for Mac" which was a win32 app
and compiled mac binaries. Is there a compiler currently available that will
do this? Or will I need to invest in a product for Mac?

Thanks again.
 
KwiGibo said:
Hi Everyone,

I've been approached to develop an application that will run on Windows as
well as Apple Macintosh platforms. Being primarily a C/C++ programmer I would
prefer to use this language. I was hoping to use Visual C++ 2003 and build
the application for both platforms.

Is this possible? If so, what additional tools will I require?

Thanks heaps for any advice or direction


In the .NET world you can use Mono in Macintosh or even in Windows!



CLI Virtual Machines

..NET framework (Windows): http://msdn.microsoft.com/netframework

Mono (GNU/Linux, Unix, Mac OS X and Windows): http://www.mono-project.com

DotGNU (GNU/Linux, Mac OS X, Windows): http://www.gnu.org/projects/dotgnu



However current VC++ doesn't produce completely verifiable managed code, so C++ managed
code can not run as it is (the same .exe) under other CLI machines. Upcoming VC++ will be
able to produce 100% verifiable code with a new compiler option /clr:safe.


Currently if you use VB and VC#, you can make GUI programs that run in both platforms.
Mono also provides a C# compiler of its own.

Also Mono, apart from providing much of the same API of .NET for compatibility with .NET,
provides additional managed APIs of its own, like GTK#. So for example you can install
Mono in your Windows clients, and use GTK#. Or if your main targeting is .NET, you can use
..NET APIs and have your applications run under .NET in Windows and Mono under Linux, Mac
OS X and whatever else, with the same .exe. Of course, you can also install Mono alone
everywhere and use the .NET APIs that are provided by Mono and have also your applications
running on all platforms that Mono supports. But I see no particular reason for that, I am
just mentioning various combinations.

Interesting possibilities indeed. :-)


However for C++, this will be only possible with the upcoming VC++ 2005 and later.
 
Ioannis said:
In the .NET world you can use Mono in Macintosh or even in Windows!



CLI Virtual Machines

.NET framework (Windows): http://msdn.microsoft.com/netframework

Mono (GNU/Linux, Unix, Mac OS X and Windows): http://www.mono-project.com

DotGNU (GNU/Linux, Mac OS X, Windows): http://www.gnu.org/projects/dotgnu



However current VC++ doesn't produce completely verifiable managed code,
so C++ managed code can not run as it is (the same .exe) under other CLI
machines. Upcoming VC++ will be able to produce 100% verifiable code
with a new compiler option /clr:safe.


Currently if you use VB and VC#, you can make GUI programs that run in
both platforms. Mono also provides a C# compiler of its own.

Also Mono, apart from providing much of the same API of .NET for
compatibility with .NET, provides additional managed APIs of its own,
like GTK#. So for example you can install Mono in your Windows clients,
and use GTK#. Or if your main targeting is .NET, you can use .NET APIs
and have your applications run under .NET in Windows and Mono under
Linux, Mac OS X and whatever else, with the same .exe. Of course, you
can also install Mono alone everywhere and use the .NET APIs that are
provided by Mono and have also your applications running on all
platforms that Mono supports. But I see no particular reason for that, I
am just mentioning various combinations.

Interesting possibilities indeed. :-)


However for C++, this will be only possible with the upcoming VC++ 2005
and later.


Of course you can install Mono in Windows and make applications that use additional Mono
facilities like GTK# with VC++ 2002/2003. But these will run on Windows only since VC++
2002/2003 place some native calls.
 
Ioannis said:
Of course you can install Mono in Windows and make applications that use
additional Mono facilities like GTK# with VC++ 2002/2003.


Actually I am not sure about this one, I guess the IDE must be set up to access the
additional Mono libraries.
 
Thanks Dave for you prompt reply and also directing my towards wxWidgets. I
heard that a while ago MS released "Visual C for Mac" which was a win32 app
and compiled mac binaries. Is there a compiler currently available that will
do this?

I'm not aware of one.

Dave
 
KwiGibo said:
Thanks Dave for you prompt reply and also directing my towards
wxWidgets. I heard that a while ago MS released "Visual C for Mac"
which was a win32 app and compiled mac binaries. Is there a compiler
currently available that will do this? Or will I need to invest in a
product for Mac?

The compiler is the least of your worries. It's the libraries and the
significant differences in how your application interacts with the OS that
are a bigger concern.

Other vendors (e.g. Metrowerks) have compilers for both Windows and Mac -
you'd have to check with them to see if they have any cross-platform GUI
libraries, or if you have to use a thrid party/open-source library for that.

-cd
 
Thanks Dave for you prompt reply and also directing my towards wxWidgets. I
heard that a while ago MS released "Visual C for Mac" which was a win32 app
and compiled mac binaries. Is there a compiler currently available that will
do this? Or will I need to invest in a product for Mac?

They did have one. I wasted a lot of money for it several years ago.
It cross-compiled for 68K & PowerPC on MacOS 7.1-8, and made simple
Windows code and resources work (somewhat) on Macs. There was a lot of
additional work required, though.

Microsoft used it for the Mac version of MS Office, and they continued
to upgrade the cross-compiler for internal use for a while after they
discontinued selling or supporting it. I doubt if they're still doing
it; it was pretty crappy.

Porting the GUI was OK, but resources were not stored as native Mac
resource. My ISO standard C modules compiled fine, but they are a
small percentage of my code.

Filesystem and database access essentially had to be done natively,
and there were many unsupported Win32 functions that had to be worked
around or coded natively. My code began to fill up with #ifdef MAC,
and I had to write several Mac-only modules.

Debugging was a nightmare. Mac OS did not have protected memory, so a
plain old application crash would usually bring the whole machine
down, like Windows 3.x. Rebooting took forever, even on a fast
machine.

I don't know a lot about other ways to port to Mac, but I've heard
decent things about WINE for porting to Linux, and it may work for Mac
OS X too.
 
Back
Top