Writing portable code

Started by
11 comments, last by Slavik81 12 years, 10 months ago

Well, because I really just need ONE Dialog and I hate dependencies. Even one DLL or .so are too much in my opinion for just one window.

If I picked a GUI toolkit I would definitely go for Qt. But I neither know if it is allowed to link Qt statically nor do I think the extra amount of work (compiling Qt statically will probably last hours) for just ONE Window...

If you plan to port your code to Linux, you will have to use some GUI library anyways I think. Writing bare XWindows interface is possible, but nothing I'd suggest anyone to do - especially if you only need one dialog ;-)
And if you have to use some GUI library anyways, why not use something like wxWidgets for both Windows and Linux versions? You can link it statically, so only the needed parts of the library will be included in your program - probably about 100kb or less. Yes - it is slightly bigger than a dialog written by bare WinAPI - but in my opinion you save a lot more in source code complexity.

Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/
Advertisement

Then when building on a platform you only build the .cpp files for that platform + common.


Hooray for link-time polymorphism! biggrin.gif


[size="1"]

Well, because I really just need ONE Dialog and I hate dependencies. Even one DLL or .so are too much in my opinion for just one window.

If I picked a GUI toolkit I would definitely go for Qt. But I neither know if it is allowed to link Qt statically nor do I think the extra amount of work (compiling Qt statically will probably last hours) for just ONE Window...

I statically linking against it possible, but is not recommended. Qt is huge.

http://doc.qt.nokia.com/latest/deployment.html#static-vs-shared-libraries

This topic is closed to new replies.

Advertisement