This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

In Eclipse, how do linked resources work? and -mcpu=cortex-m4?

I am using an example file provided in the "Development with GCC and Eclipse". The file has many .c files in the "Project->Resource->Linked Resource" area. There are no corresponding .h files. How are the .h files included?

Also the compiler has this flag set "-mcpu=cortex-m4". Where is that defined? I set the device tab to "NRF51822_xxAA". I've seen a place the define the type of processor, but I can't find it in this setup.

And another thing. Command-B builds all the projects, how to I set it to build only the current project?

  • Hi,

    The header files in typically not included specifically in the projects, but included by the source files and searched in the include paths when compiling the application. The include paths are added to the project as described in the section "Enable auto discovery of symbols, include paths and compiler settings" in the tutorial.

    The flag -mcpu=cortex-m4 is part og the GCC compiler. -m options are Machine-Dependent Options, and each target machine supported by GCC can have its own options. This is used to let GCC know what the target CPU is, as different CPUs have different instruction set. You can see all the machine-dependent options for ARM targets on this page.

    EDIT: Google is your friend when it comes to Eclipse functionality and shortcuts: Build Project keyboard shortcut in Eclipse CDT

    Best regards,

    Jørgen

Related