This paper introduces an optimization template library (OTL), a cross-platform C++ template library for multiobjective optimization. OTL has an object-oriented architecture, which allows that different modules can be arbitrarily combined with each other. Moreover, the C++ template technique is used to increase the flexibility of OTL. Meanwhile, generic programming is widely used in OTL, and the generic algorithms can be used to process different data structures. However, compared with C++, the Python script is more suitable for building the experimental platform. To ensure that all attributes of the experimental results can be fully maintained, a database is used to store the experimental data. Moreover, batch experiments can be easily defined in a set of configuration files; thus, the experiments can be executed automatically without human intervention. In addition, serial and various parallel execution modes are supported, and the user can easily switch the running mode to distributed computing to increase the computing speed. Finally, a highly customizable data visualization tool is created to play back the data sample stored in the database. From a series of comparative studies, the accuracy and running performance of OTL are verified by the statistical results.