eclipse c/c++ CDT build just one file

前端 未结 2 715
日久生厌
日久生厌 2021-02-18 14:57

I\'m doing a C++ project with eclipse CDT but It takes a lot of time building all the source files.

I\'d prefer just build the one source file which I\'m working with un

相关标签:
2条回答
  • 2021-02-18 15:27

    If you're using makefile project. Simply add '-j n' (n specifies the concurrent job number) into your make parameter.

    open 'project properties' -> 'C/C++ Build' -> 'Behavior'(page label) -> 'Build (incremental build'(edit box)

    e.g. change it to '-j 3 all', will tell make to compile 3 files at same time.

    Of course, make will detect file dependencies to decide whether the files can be compiled at same time.

    cheers

    0 讨论(0)
  • 2021-02-18 15:35

    It was much easier than expected.

    1. Deselect Project -> Build Automatically
    2. Right click on the file you want to build
    3. Click on Build Selected File(s).

    Source: http://www.cesareriva.com/single-file-compile-in-eclipse-cdt/

    0 讨论(0)
提交回复
热议问题