The cross-platform features of C/s + + are more primitive than Java (Java is a compile-time operation, and C/s + + needs to be recompiled with the source code), and implementing a cross-platform program for C/s + + is generally a few practices: 1. Using QT2. Using ANSI C + + Supported functions 3. Conditional compilation, such as # if defined (__symbian32__) #define Xx_platform Xx_platform_symbian#elif defined (__win32__) | | (_WIN32) #define Xx_platform Xx_platform_win32#elif defined (__APPLE__CC) #if environment_iphone_os_version_min_ required__>=40000 #define Xx_platform Xx_platform_apple_ios #else #define Xx_platform xx_platform_apple4. For use in libraries Data types are cross-platform defined, such as the int encapsulated as Xx_int, the string encapsulated as xx_string, and the bool encapsulated as Xx_bool ... 5. Cross-platform definitions for domain definitions, such as private encapsulation as xx_private, and public encapsulation as xx_public ... 6. Completely customize messages or events to eliminate the use of specific system messages and response functions (which is why QT creates signal and slots)
SDK cross-platform experience realized by C + +