开发者

Making a program platform independent

开发者 https://www.devze.com 2022-12-26 03:06 出处:网络
I\'m working with an OCR project which is developed using Visual C++ on .net framework. But since the .net is platform dependent I want to make this project platform independent and make it supports t

I'm working with an OCR project which is developed using Visual C++ on .net framework. But since the .net is platform dependent I want to make this project platform independent and make it supports to multiple operating systems.

So can some one give me a hint to how to do it. Than开发者_Python百科ks.


Mono is a cross-platform implementation of .NET that you might consider.


Why are you using Visual C++ running on .Net? I would recommend you either switch to Native C++, or use a better .NET language like C#. To be honest I'm not sure that Mono can handle the managed C++ thing.

If switching to native C++, then be sure to abstract away any platform specific bits. Also, be sure that your application will run on both 32 and 64 bit. Use platform-independent APIs such as GTK or WxWidgets.

If you switch to C#, then read up on what some of the APIs are that Mono does not(and never will) support. Do not do any unsafe code or P/Invokes.

And no matter which way you choose, Always regularly test your program on Windows and Linux. If it works on Linux it usually works on Mac too, but I'd test on all three at least once a day


You also can try Qt. You can use Visual C++ for Windows platform, and g++ with other platforms (Mac/Linux). It gives you much better GUI than Mono can give.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号