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

Makefile compiles but Eclipse can't find platform headers

I followed the Nordic tutorial on wrapping an SDK sample project in a Makefile managed Eclipse project. I used the ble_app_beacon as the project. Eclipse will build the project and I can debug the project. But Eclipse also tries to help me by providing some highlighting of build errors (which are not found by 'make'). The fact that 'make' can build the project is enough to get my working but the fact that Eclipse thinks there are build errors takes away from the benefit of using Eclipse. I've included a screen shot, below. The build output is attached as a file.

Note that I followed the Nordic tutorial which included adding VERBOSE=1 and enabling the capture of the build output back into Eclipse. That tutorial also had me add the referenced source files into virtual folders in the Project Explorer. For example, you can see in the screen shot that components/ble/common/ble_srv_common.c has the key icon in the upper right corner. I can look at the properties of that file and see the header dependencies are what we expect.

But the trouble seems to be that Eclipse is not finding the platform headers which would include the definitions we expect for things such as uint8_t. I would expect those to come from the GNU ARM tools, right? I guess those do not get revealed as output from the build process and, therefore, are not captured back into Eclipse (or something like that).

Do you have any advice on how to get Eclipse satisfied in finding those type of headers in the context of a Makefile managed Eclipse project?

Thanks.

My environment:

  • Mac OSX
  • SDK for nRF52832: PCA10040 (for nRF52832_xxAA)
  • Eclipse Neon V3 IDE for C++ developers (I've read postings that V3 works on OSX)
  • GNU ARM Eclipse Plug-in
  • GNU ARM Tools (6-2017-q1-update)
  • SEGGER JLINK tools

image description

EclipseBuildOutput.txt

  • There are global defines in Makefile which Eclipse cannot parse and so it doesn't understand them. If you want them to be visible within Eclipse IDE you need to provision them manually into the project (and then change manually each time you change them in the Makefile). Don't ask me how this is done in detail, I'm sure Google can help.

    To your project set-up: I usually create simply new project from existing source and Makefile on the disk and then add whole SDK as virtual folder. After Refresh and Index rebuild Eclipse can see all the functions, modules and symbols but still need global defines from Makefile to correctly understand everything.

  • Hi,

    The toolchain paths and symbols should be added automatically by the GNU ARM eclipse plugin. You can try to enable CDT Cross Built in Compiler Setting and see if you get the same result. The include directory shown the project view in the screenshot below should pop up if the plugin sees the toolchain path.

    image description

    In addition, Eclipse does not seem to parse the pre-processor symbols from the output, only include paths. Recommend to rebuild your project with the patched makefile.common file included at the end of the tutorial.

  • This is why I think Eclipse Makefile projects are the worst of both worlds and I don't think Eclipse native projects are great. You're building a project with a Makefile and then asking an IDE to guess its way through that project structure and pretend it's a native project and give you all the autocomplete and other help you'd get. And this is Eclipse which is pretty bad in general and awful for embedded development.

    The best answer to Eclipse issues is usually 'use something else'.

Related