Two common compilation methods for cross-platform C ++ open-source code

Source: Internet
Author: User

Two common compilation methods for cross-platform C ++ open-source code

The cross-platform C ++ open source code uses two methods to adapt to the compilation of various compilers. One is makefile. Taking the famous Spatial Data Format Parsing Library gdal as an example, it provides makefile for various compilers to compile. Gdal mainly provides makefile in two formats: Microsoft VC compiler and gnu gcc compiler. makefile can be found in the source code root directory of gdal. there are two makefile files: vc and GNUmakefile. vc is the makefile of the vc compiler, and GNUmakefile is the makefile of the gnu gcc compiler.

Another method is to use the CMake software. The CMake software can be seen as building the engineering format of each IDE Vendor Based on the source code. CMake is an open-source software. Some IDES (compilers) supported by CMake include:

It can be seen that CMake supports many ides. The output directory of the CMake software is used to the cmake folder under the root directory of the open source code.

Cross-platform C ++ open-source code generally supports at least makefile or CMake compilation. How can I determine the methods supported by an open source code? Compile, which should support CMake compiling.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.