Создание кросс-платформенного приложения Windows, Mac OS X
Я хотел бы создать приложение, которое работает как на Windows, так и на Mac OS X. Я бы также нравится использовать лучшее из того, что платформа, на которой она работает, может предложить в отношении фреймворков, API и т. д. Есть ли способ сделать это без необходимости писать код Objective-C, а затем код c#? Я думал о C++ в качестве альтернативы, но мне было интересно, есть ли что-нибудь еще. Приложение будет основано на GUI (хотя я точно не знаю, что он будет делать пока)
хорошо, что вы думаете о переносимости на раннем этапе – гораздо сложнее “закрепить его” после этого факта.
доступны различные кросс-платформенные комплекты, но IMHO все они немного не обеспечивают “родной” внешний вид на всех поддерживаемых платформах. На Mac (что я использую), сторонники таких наборов всегда хочу отметить, что они используют собственные элементы управления. Это хорошее начало, но не весь путь. Другие вопросы, рассмотренные руководство по человеческому интерфейсу Apple включите, как должны быть организованы элементы управления, как должны быть сформулированы метки кнопок, какие стандартные сочетания клавиш должны использоваться и т. д.
даже Microsoft пришлось узнать трудный путь об опасностях попытки написать кросс-платформенный графический интерфейс, с злополучным словом 6.0 для Mac.
ИМХО, лучший подход-использовать MVC дизайн, с модельным слоем написанным в стандартном, портативном К++, и просмотр и слои контроллера с использованием собственного инструментария для каждой платформы. Для версии Mac Carbon и C++ во всем были интересным вариантом, который теперь больше не поддерживается, поэтому вы хотели бы использовать Cocoa, используя Objective-C в представлении и Objective-C++ в ваших контроллерах для преодоления языкового разрыва. Ваша версия Windows также может скомпилировать вашу модель как “управляемый C++” и использовать любой язык .NET для контроллеров и представлений.
посмотри Real Studio. Серьезно. Вы можете написать приложение в Real Studio и развернуть его в Windows, Mac OS X и Linux.
Mac OS X shared library cross platform development
I should confess I do not even own a Mac, I have done Windows and Linux programming. Here I hope to learn something about Mac OS X by relating it to Linux if possible. And hopefully to be able to compile a Mac shared library without purchasing a Mac.
Note: There is absolutely no GUI, so Cocoa should not be required right? Also imagine I use C or c++0x, and POSIX for now.
What are the differences between Mac OS X shared library and Linux? What is required to be able to run Linux .so files on Mac? Do I need a Mac-native replacement for ld-linux.so, and linux-gate.so or some other crt related object files?
Is there any cross platform gcc for Mac on Windows or Linux? (again no GUI)
1 Answer 1
Even though you don’t need Cocoa/Objective-C, you still need to link against Mac OS X libraries (like libSystem , which is like libc on Linux). The file format is totally different (ELF vs. Mach-O) so there is no way to make a Linux library or tool work on a Mac without recompilation.
If you stick to POSIX/SUS APIs you can easily write things so they compile on both Linux and Mac without changes as long as you don’t try any platform-specific things like reading Linux /proc files.
There doesn’t seem to exist any cross-compiler for Linux-to-Mac development and I can’t imagine anyone trying to do this: you’d be chasing a moving target without any real benefit.
The solution as always with these type of questions: buy a used MacMini on eBay or similar auction platform. They’re cheap and will suffice.
Create a cross platform Windows, Mac OS X application [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 months ago .
I would like to build an application that runs on both Windows and Mac OS X. I would also like it to leverage the best of what the platform it runs on has to offer with regards to Frameworks, API’s etc. Is there a way to do this without having to write Objective-C code and then C# code? I’ve been thinking of C++ as an alternative but I was wondering if there was anything else out there. The app will be GUI based (though I don’t know exactly what it will do yet)
21 Answers 21
It’s good that you’re thinking of portability early on – it’s vastly more difficult to “bolt it on” after the fact.
There are various cross-platform kits available, but IMHO all of them fall a bit short of providing a “native” look and feel on all the supported platforms. On the Mac (what I use), proponents of such kits always want to mention that they’re using native controls. That’s a good start, but it’s not the whole journey. Other issues addressed by Apple’s Human Interface Guidelines include how the controls should be arranged, how button labels should be phrased, what standard shortcut keys should be used, etc.
Even Microsoft had to learn the hard way about the dangers of trying to write a cross-platform GUI, with the ill-fated Word 6.0 for Mac.
IMHO, a better approach is to use an MVC design, with the model layer written in standard, portable C++, and the view and controller layers using the native toolkit for each platform. For the Mac version, Carbon and C++ throughout used to be an interesting option that is now not supported anymore, so you would want to use Cocoa, using Objective-C in the view and Objective-C++ in your controllers to bridge the language gap. Your Windows version could likewise compile your model as “managed C++”, and use any .NET language for controllers and views.
C++ Cross platform development (Windows and Mac OS)
I’ve got new task to research the way of development C++ cross platform (Mac/Win) utility for our internal needs.
I’ve developed for 7 years using different “pink” languages like C# , Java , Managed C++. But in this task , the requirement is to support Mac , and .NET that is running on Mac , is really pain (Know this from other guys who did used this).
So I’ve started to think about C++ if it’s possible to use C++ for Cross platform development. The application will no contain any GUI , but will contain a lot of System API calls , and a lot of business logic analysis.
Is there possible some library allowing to achieve such kind of Task ? Is it possible to do at all ?
2 Answers 2
Yes, you can write standard, ISO C++ and run the programs on both platforms.
When you need to implement some functionality using platform specific APIs (e.g. using Win32 on Windows and POSIX APIs on Mac OS) then what you do is write your own wrapper functions that abstract away the platform specific details, and then use that wrapper in the rest of your program.
Tools like CMake will allow you use Visual Studio to build the program on Windows and Xcode to build on the Mac without having to manually manage separate Visual Studio and Xcode project files.
If I understand your question properly, the only thing you need to develop cross platform c++ is to get the right compilers. You could use GCC on both platforms or even use 2 different project files for visual studio and xcode. That’s up to you. Personally, I prefer GCC.
Regarding code itself, it depends on what you do with it. STD is available on both platforms (std::vector, std::string, etc) so code should compile properly on both platforms.
Edit: Btw, most platform specific stuff are available through open source code (like boost though I personally don’t like boost that much). If needed, you could even look at other open source projects that are cross platform (ogre3d, etc).
Question: Q: Cross-platform programs Mac & PC
I’m two months into switching for PC to Mac and I’m still a little put out by having to give up the programs I use to do my work. In fact, in many cases I’m going back to WinXP via Parallels to do the work and returning to the Mac for fooling around, web surfing, etc.
What I’d like are cross-platform programs in these categories; if you have ideas, please jump in:
A simpler program than Pagemaker or InDesign (though I have both of those) for doing flyers, posters, handouts, etc. Something like MS Publisher but that runs on both WinXP and Intel Mac.
I don’t do much of this, but at present use Sandvox/iWeb/Rapidweaver for one of my small sites, and MS Frontpage 2003 for my 850 page magazine site. I’ve tried Dreamweaver (steep learning curve and poor management controls for large site, too elaborate for small site), GoLive (ditto), and a bunch of smaller programs. Like the Sandvox/Rapidweaver model, but there is no way to convert my large (850 pages) site, and the programs would probably crash when faced with that many pages. This large site is not complex, and the design is dirt simple (it’s a literary magazine), but it still need quarterly attention.
(c) There are others — financial (I’ve accepted the Mac version of Quicken but it’s lousy compared to the PC version, which itself isn’t as good, in my view, as MS Money for WIn), photo manipulation and organizers (all the Mac programs (save iView) are slipshod, slow, wed to the imported library model (not my fave), and slow. Slower.
Basically what I’m finding is that while I prefer the Mac for the look and feel, and the operation, too–drag & drop executed pretty thoroughly–the PC has such a huge advantage in variety and type of programs available that it’s hard to imagine how the Mac has lasted this long with 5% or 10% of the market.
iMac 20″ Core Duo, Mac OS X (10.4.6), Bootcamp, Parallels, Win XP
Posted on Aug 7, 2006 11:26 PM
You might give Freeway Pro a test drive to see if it’s up to your task. It’s supposedly pretty good software and a bit like FrontPage. It’s also a universal binary. With any luck Adobe may have universal binary versions of their products available before next year (who knows.) You might try Quark for layout. It’s now available as a universal binary.
The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.
Posted on Aug 8, 2006 12:09 PM
Unfortunately, what I may think is great you may not. Software preference is highly personal. I’m a very practical person. Were I in your position (and once I was, although I never used PCs) I would simply find what was the best software for my needs and learn how to use it. I’m more concerned with getting the job done than I am with the mechanics of the software. But then that’s my preference. I critique literature, I don’t create literature.
That said I think the best layout program for the Mac is InDesign. Unfortunately, no Adobe product is a universal binary so they run much slower on Intel Macs than on PowerPC Macs because of the Rosetta emulation. Many other users think the best layout program is Quark. I have not used Quark in many years so I can’t speak intelligently about it. However, the most recent release is supposed to be a universal binary. That should make it faster on Intel Macs.
Programs like Sandvox, iWeb, etc. are intended for beginners. None of them are intended to design or manage large websites. I would not recommend them for your site. Because I don’t design or maintain a large website I haven’t used any of the software available for the task. What’s out there that you may try include: Freeway Pro (Intel ready), DreamWeaver, Stone Works (Intel ready), and PageSpinner (Intel beta available.)
As for financial programs I simply can’t really recommend anything. I don’t ever use them. I know Quicken is available and its main competitor MYOB. I use a CPA but then that’s my preference.
As for graphics the Mac has always been considered the best graphics platform around. If you can’t find a great graphics application, then you’re just too hard to please. In addition to PhotoShop and PhotoShop Elements, there’s GIMP, Seashore, InkScape, Cenon (these are all free and intel ready), and hundreds others.
And, I’m not admonishing you but simply asking you to face facts. If the only software you feel is adequate for your work only runs on PCs, then you’re using the wrong computer – switch back. That is the sensible decision. Whatever other reasons you may have had for switching to the Mac, none of them outweigh the need for the software and the hardware on which it runs. This is just good business decision-making. Would you buy a Lexus sedan to race at Le Mans or a Ferarri?
I’m tickled pink that you switched to a Mac. But I’m not impractical. I could not advise anyone to switch to a Mac if in doing so they could no longer do their work properly and productively. Now, I believe that Mac software is up to the job, but clearly you don’t. Unless you are going to adjust to the changes you will not be happy.
I wish I could be more helpful than this, and I wish you luck in your quest. If I can help you in any other way please feel free to ask. These Discussions are a wealth of information if your patient.