New answers tagged

2

A possible way to help portability could be to rely only on declarations and features provided by the C++11 standard, and by using cross-platform libraries and frameworks like POCO & Qt. But even this is not fail-proof. Remember the aphorism there is no such thing as a portable program, there are only programs which have been successfully ported (to ...


9

Creating portable code can be very challenging. First some obvious language related advices: use standard C++ and avoid carefully any undefined behavior rely primarily on standard library (and portable libraries such as boost) always include all expected headers. Do not assume that you don't need a header because it's included in another one (i.e.on ...


3

It depends on the "some compilation errors" you mention. Without knowing what they were, it's impossible to be specific. I've got cross-platform code for Windows / Linux / iOS / Android / Mac. Each new platform brought some extra errors and warnings when it was first added. You will quickly learn which constructs bring problems. Either avoid them, or ...


7

If you are asking for "development processes" and you primary development platform is Windows with Visual Studio then I would suggest to try building your project without "windows.h" included. You will get a lot of compilation errors that will point you to many places where you'll need to refactor your code. For example, 'DWORD' won't be #defined and you'll ...


10

There is nothing that can guarantee that the code is compatible with a platform other than building it, running it, and testing it there. Therefore, the approach of all sane people is to build, run and test their application on every platform that they project it will need to be built, run, and test on. Continuous Integration (CI) can ease this burden a ...


0

The most common way to use a SOCKS proxy server in the Linux world is to do so via a shared library that intercepts calls to standard socket functions and redirects them to the proxy server. This does not allow multiple connections to different servers, however (except by configuring different servers for different addresses, but that doesn't seem to be ...


0

I have not used Glade a great deal but from my limited experience I have found it to be much friendlier than Qt Designer. The bigger issue is whether you desire the full app developement eco-system provided by Qt, or a thin widget toolkit provided by GTK. The deciding factor for me was the need to target embedded systems, e.g. no X11. Qt provides this out of ...


7

As the co-founder of Codename One which does pretty much that I can answer that pretty easily. You can cross compile (which is what we do) but you can't have a single binary that will work everywhere because mobile OS vendors don't allow it. Apple doesn't allow JIT's and limits interpreters. All mobile devices include app isolation which prevents a global ...


0

I wrote a completely different answer, suggesting that your publisher writes updates to a queue or a pipe -- but I then I re-read the question. If I understand right your general question is that you want to write a library to run in the JRE, in which a native front-end can query the state of Java objects in a thread-safe manner. This is incredibly broad ...


5

For trivial examples, any form of additional overhead will appear massive. The benefit of separating into TUs is that you know that everything in the file is specific for the platform and you can use platform functionality in convenience functions without having to be careful about surgically placing it in the correct preprocessor sections. This also helps ...



Top 50 recent answers are included