C++ covers the whole range from low-level to high-level programming, making it ideally suited for writing portable software. However, code portability is often neglected in embedded systems engineering. With hardware becoming more and more interchangeable, this oversight can turn into a problem when software must be ported to a new platform. This paper shows tools and techniques to design and build portable software in C++. You will learn how to use C++ features to encapsulate platform-dependent parts (compiler/language differences, RTOS APIs, I/O) of their programs, thus ensuring portability of the resulting system.