text.skipToContent text.skipToNavigation
  1. Home
  2. Computer Science & IT
  3. Cross-Platform Development in C++: Building Mac OS X, Linux, and Windows Applications

Cross-Platform Development in C++: Building Mac OS X, Linux, and Windows Applications, 1st edition

  • Syd Logan

Published by Addison-Wesley Professional (November 27th 2007) - Copyright © 2008

1st edition

Chosen format
View all
Cross-Platform Development in C++: Building Mac OS X, Linux, and Windows Applications

ISBN-13: 9780132799874

Includes: Instant Access

This product is not available in your country

What's included

  • Instant Access

    You'll get instant access to the digital content.

Overview

Cross-Platform Development in C++ is the definitive guide to developing portable C/C++ application code that will run natively on Windows, Macintosh, and Linux/Unix platforms without compromising functionality, usability, or quality.

 

Long-time Mozilla and Netscape developer Syd Logan systematically addresses all the technical and management challenges associated with software portability from planning and design through coding, testing, and deployment. Drawing on his extensive experience with cross-platform development, Logan thoroughly covers issues ranging from the use of native APIs to the latest strategies for portable GUI development. Along the way, he demonstrates how to achieve feature parity while avoiding the problems inherent to traditional cross-platform development approaches.

 

This book will be an indispensable resource for every software professional and technical manager who is building new cross-platform software, porting existing C/C++ software, or planning software that may someday require cross-platform support.

 

Build Cross-Platform Applications without Compromise

 

Throughout the book, Logan illuminates his techniques with realistic scenarios and extensive, downloadable code examples, including a complete cross-platform GUI toolkit based on Mozilla’s XUL that you can download, modify, and learn from. Coverage includes 

  • Policies and procedures used by Netscape, enabling them to ship Web browsers to millions of users on Windows, Mac OS, and Linux
  • Delivering functionality and interfaces that are consistent on all platforms
  • Understanding key similarities and differences among leading platform-specific GUI APIs, including Win32/.NET, Cocoa, and Gtk+
  • Determining when and when not to use native IDEs and how to limit their impact on portability
  • Leveraging standards-based APIs, including POSIX and STL
  • Avoiding hidden portability pitfalls associated with floating point, char types, data serialization, and types in C++
  • Utilizing platform abstraction libraries such as the Netscape Portable Runtime (NSPR)
  • Establishing an effective cross-platform bug reporting and tracking system
  • Creating builds for multiple platforms and detecting build failures across platforms when they occur
  • Understanding the native runtime environment and its impact on installation
  • Utilizing wxWidgets to create multi-platform GUI applications from a single code base
  • Thoroughly testing application portability
  • Understanding cross-platform GUI toolkit design with Trixul

Table of contents

Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii

About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1

Areas That Can Affect Software Portability . . . . . . . . . . . . . . . . . . . 3

The Role of Abstraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1 Policy and Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Item 1: Make All of Your Platforms a Priority . . . . . . . . . . . . . . . . . 17

Item 2: Code from a Common Codebase . . . . . . . . . . . . . . . . . . . . 22

Platform Factory Implementations . . . . . . . . . . . . . . . . . . . . . . . 29

Implementation Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Platform-Specific ProcessesImpl Classes . . . . . . . . . . . . . . . . . . . 32

Creating the Instance Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . 42

Organizing the Project in CVS or SVN . . . . . . . . . . . . . . . . . . . 45

Makefiles and Building the Code . . . . . . . . . . . . . . . . . . . . . . . . . 49

Item 3: Require Developers to Compile Their Code

with Different Compilers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Item 4: Require Developers to Build Their Code on

Multiple Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

Item 5: Test Builds on Each Supported Platform . . . . . . . . . . . . . . . 60

Item 6: Pay Attention to Compiler Warnings . . . . . . . . . . . . . . . . . . 61

GNU Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

Microsoft Visual C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

2 Build System/Toolchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

Item 7: Use Whatever Compiler Makes the Most Sense

for a Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

Item 8: Use Native IDEs When Appropriate . . . . . . . . . . . . . . . . . . 67

Item 9: Install and Use Cygwin on Windows . . . . . . . . . . . . . . . . . . 71

Item 10: Use a Cross-Platform Make System . . . . . . . . . . . . . . . . . . 76

Make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

Building on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

Autoconf/Automake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

Imake . . . . . . . . . . . . . . .

For teachers

All the material you need to teach your courses.

Discover teaching material