6 years ago.

GNU_ARM_ECLIPSE project build errors

I created a project on the online compiler for nRF52DK Nordic board. It compiles and generates the hex file. The prototyping phase is over and I'm in the actual development stage working with the actual controller chip. I thought of using Eclipse for the same project to make changes and communicate with the actual chip using the debugger.

I downloaded the GNU ARM ECLIPSE project from the compiler using the export option.

I opened the project in the Eclipse environment, however when I build the project I'm facing errors

/media/uploads/ajinkyamandhre28/mbed_os_eclipse_error.png

Error message on Eclipse

field '_can' has incomplete type 'can_t {aka can_s}' CAN.h /Palcare_Integrated_volatile/mbed-os/drivers line 251 C/C++ Problem

field '_dac' has incomplete type 'dac_t {aka dac_s}' AnalogOut.h /Palcare_Integrated_volatile/mbed-os/drivers line 145 C/C++ Problem

make: * [mbed-os/platform/ATCmdParser.o] Error 1 Palcare_Integrated_volatile C/C++ Problem

make: * [mbed-os/rtos/RtosTimer.o] Error 1 Palcare_Integrated_volatile C/C++ Problem

make: * [mbed-os/rtos/Thread.o] Error 1 Palcare_Integrated_volatile C/C++ Problem

make: * Waiting for unfinished jobs.... Palcare_Integrated_volatile C/C++ Problem

Member declaration not found CAN.cpp /Palcare_Integrated_volatile/mbed-os/drivers line 37 Semantic Error

recipe for target 'mbed-os/platform/ATCmdParser.o' failed subdir.mk /Palcare_Integrated_volatile/Debug/mbed-os/platform line 94 C/C++ Problem

recipe for target 'mbed-os/rtos/RtosTimer.o' failed subdir.mk /Palcare_Integrated_volatile/Debug/mbed-os/rtos line 37 C/C++ Problem

recipe for target 'mbed-os/rtos/Thread.o' failed subdir.mk /Palcare_Integrated_volatile/Debug/mbed-os/rtos line 37 C/C++ Problem

Symbol '_can' could not be resolved CAN.cpp /Palcare_Integrated_volatile/mbed-os/drivers line 37 Semantic Error

Symbol '_irq' could not be resolved CAN.cpp /Palcare_Integrated_volatile/mbed-os/drivers line 37 Semantic Error

The project builds perfectly on the online compiler, However when I'm trying to get it on eclipse I'm facing troubles.

Note: 1) I have added the GNU tool chain. 2) Added the missing directories in the Include sections 3) Added the missing contents of device.h file

1 Answer

6 years ago.

First obvious question are you actually using the CAN and AnalogOut drivers? If not just remove them from the project - it will save you the trouble of messing with them. You can also exclude source files rather than fully deleting them - In Eclipse right click -> Resource Configuration -> Exclude from Build. I have exported projects to eclipse several times and going through and removing or excluding unused files was part of the setup process. And mbed.h includes a lot of these driver files but you can take those lines out. Actually in the project I'm working on right now I note I have done just that, inside mbed.h commented out AnalogOut.h. If I build with AnalogOut.h included I get the same error you do. The header file's still in my project folder but no longer gets in the way as long as I don't reference it.

//#include "drivers/AnalogOut.h"

I have most of folders Tests, Tools, and Features also disabled from the project.