日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

4.2.1. Eclipse Managed Build — C/C Software...

 WUCANADA 2012-04-10

4.2.1. Eclipse Managed Build

To begin with, this can be the simplest way to build a new Project. (But it only works with GCC and other Eclipse supported tool-chains.) [1]

CDT gives a GUI to:

With Eclipse managed build, Eclipse can automatically create a set of makefiles. These make files can be used with standard make utility. Thus, if the project is managed within Eclipse, developers not using Eclipse can still build the software. It is also useful for automated standalone builds.

Note

Older versions of CDT used to refer this as a Managed make project

4.2.1.1. Creating a sample project

  1. Click File ? New ? Project

  2. Select C Project

    ../../../_images/e-wiz-new-prj-sel-c.png
  3. Name the project as Hello World.

  4. Select project type as Hello World ANSI C Project

  5. Select Tool-chain as MinGW GCC

    Select an empty Hello world ANSI C Project
  6. Click Next button

  7. Input your details

    Input your details
  8. Click Next button

  9. Select Advanced settings

    Go to Advanced Settings
  10. Select Current builder as Gnu Make Builder

    Select GNU Make builder in advanced settings of Eclipse
  11. Click OK button

  12. Click Finish button

  13. If you get a message to switch perspective, Click Yes

    Accept the request to change the perspective.

    This happens if the previous perspective was not C/C++ perspective.

This is how the Project Explorer view would look like.

A sample view of the Project Explorer of Eclipse
  1. The name of the project HelloWorld
  2. Eclipse would list executables and libraries of the project here.
  3. Eclipse would list include directories and header files here.
  4. Eclipse generated folder. The name is derived from the build configuration.
  5. Eclipse generated Makefiles
  6. The actual source file.

To build the project, do either of:

  • Press Ctrl + B

  • Click Project ? Build All

  • Press the Build Button

    The build button in Eclipse toolbar

4.2.1.2. Build Configuration

Build configurations are different ways of building a code. The most basic would be Debug mode and Retail Mode. In Debug mode, the generated objects and executables have Debug symbols. For large projects, this can become further complicated. Including files for test code, excluding files for test code, etc.

Each configuration can have unique set of source files, includes, #defines, and other compiler/linker parameters.

4.2.1.3. Changing Build Settings

Eclipse gives control over how the project gets build.

4.2.1.3.1. Include / Exclude Files from Build

Use Right Click ? Resource Configuration ? Exclude From Build to add/remove a source file from a Build Configuration

Even finer control can be achieved through, Project ? Properties ? C/C++ General ? Paths and Symbols ? Source Location (See Including / Excluding files & directories from build)

../../../_images/c-prj-prop-source-location.png

Including / Excluding files & directories from build

4.2.1.3.2. Compiler Directives

Through Project ? Properties ? C/C++ General ? Paths and Symbols ? Includes we can Add include paths to build.

../../../_images/c-cpp-add-more-includes.png

Add include paths to build

Through Project ? Properties ? C/C++ General ? Paths and Symbols ? Symbols we can Add compiler defines to build.

../../../_images/c-cpp-add-more-defines.png

Add compiler defines to build

4.2.1.3.3. Change the Make Utility

To Change the default build utility, from make to something else, go to Project ? Properties ? C/C++ Build ? Builder Settings

../../../_images/c-build-change-make-utility.png

Change the default build utility

To change Advanced build settings , e.g. using Parallel jobs for build (-j), or build on every save, go to Project ? Properties ? C/C++ Build ? Behaviour

../../../_images/c-build-make-advanced-settings.png

Advanced build settings

4.2.1.3.4. Advanced toolchain specific settings

The tool-chain can be selected form Project ? Settings ? C/C++ Build ? Tool Chain Editor.

To Change general settings of the Tool-Chain, like, enable warnigns (-Wall), don’t include standard system header files during compilation (-nostdinc), etc. go to Project ? Settings ? C/C++ Build ? Settings ? Tool Settings

../../../_images/c-cpp-prj-toolchain-settings.png

Change general settings of the Tool-Chain

We can also Change the build artifacts (dll/lib/exe). We can control if we want to build a DLL/Shared Object, static library, or an Executbale out of this project.

../../../_images/c-cpp-build-type-exe-lib-dll.png

Change the build artifacts (dll/lib/exe)

4.2.1.3.5. Pre-Build and Post-Build Steps

To Add pre-build and post-build steps, go to go to Project ? Settings ? C/C++ Build ? Settings ? Build Steps

../../../_images/c-cpp-build-steps.png

Add pre-build and post-build steps

[1]Cygwin GCC, Linux GCC, MacOSX GCC, MinGW GCC, Solaris GCC are supported by default. The Proprietary distributions based on Eclipse would also support the toolchains of that distribution.

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多