Chapter 25
Developing Cross-Platform and Cross-Language Applications
WHAT’S IN THIS CHAPTER?
- How to write code that runs on multiple platforms
- How to mix different programming languages together
C++ programs can be compiled to run on a variety of computing platforms and the language has been rigorously defined to ensure that programming in C++ for one platform is very similar to programming in C++ for another. Yet, despite the standardization of the language, platform differences eventually come into play when writing professional-quality programs in C++. Even when development is limited to a particular platform, small differences in compilers can elicit major programming headaches. This chapter examines the necessary complication of programming in a world with multiple platforms and multiple programming languages.
The first part of this chapter surveys the platform-related issues that C++ programmers encounter. A platform is the collection of all of the details that make up your development and/or run-time system. For example, your platform may be the Microsoft Visual C++ 2010 compiler running on Windows 7 on an Intel Core i7 processor. Alternatively, your platform might be the GCC 4.6 compiler running on Linux on a PowerPC processor. Both of these platforms are able to compile and run C++ programs, but there are significant differences between them.
The second part of this chapter looks at how C++ can interact with other programming languages. While C++ is a general-purpose ...