Note that there are some explanatory texts on larger screens.

plurals
  1. POEclipse CDT error: "Symbol 'XXX' could not be resolved"
    text
    copied!<p>I have an embedded C project that builds and runs just fine using make on the console, but Eclipse CDT is giving me errors.</p> <p>In main.c, this function uses a macro, APP_BUTTON_INIT:</p> <pre><code>static void buttons_init(void) { static app_button_cfg_t buttons[] = { {SIGNAL_ALERT_BUTTON, false, NRF_GPIO_PIN_NOPULL, button_event_handler}, {BONDMNGR_DELETE_BUTTON_PIN_NO, false, NRF_GPIO_PIN_NOPULL, NULL} }; APP_BUTTON_INIT(buttons, sizeof(buttons) / sizeof(buttons[0]), BUTTON_DETECTION_DELAY, false); } </code></pre> <p>The APP_BUTTON_INIT macro is defined in app_button.h like this:</p> <pre><code>#define APP_BUTTON_INIT(BUTTONS, BUTTON_COUNT, DETECTION_DELAY, USE_SCHEDULER) \ do \ { \ uint32_t ERR_CODE = app_button_init((BUTTONS), \ (BUTTON_COUNT), \ (DETECTION_DELAY), \ (USE_SCHEDULER) ? app_button_evt_schedule : NULL); \ APP_ERROR_CHECK(ERR_CODE); \ } while (0) </code></pre> <p>The error is</p> <pre><code>Symbol 'app_button_evt_schedule' could not be resolved </code></pre> <p>But that function is defined further down in the very same header file, app_button.h:</p> <pre><code>static __INLINE uint32_t app_button_evt_schedule(app_button_handler_t button_handler, uint8_t pin_no) { app_button_event_t buttons_event; buttons_event.button_handler = button_handler; buttons_event.pin_no = pin_no; return app_sched_event_put(&amp;buttons_event, sizeof(buttons_event), app_button_evt_get); } </code></pre> <p>I've tried Project right click -> Index -> Rebuild and Freshen all files, no joy. I'm using Eclipse Kepler SR1 with CDT 8.2.1. Why can't Eclipse see this function?</p> <p>The first operation of the makefile is this (this works):</p> <pre><code>mkdir _build "/Users/Eliot/dev/gcc-arm/bin/arm-none-eabi-gcc" -DNRF51822_QFAA_CA -mcpu=cortex-m0 -mthumb -mabi=aapcs -DNRF51 -DBOARD_NRF6310 -DNRF51822_QFAA_CA --std=gnu99 -Wall -Werror -mfloat-abi=soft -DDEBUG -g3 -O0 -I"/Users/Eliot/dev/nrf51822/Include/ble" -I"/Users/Eliot/dev/nrf51822/Include/ble/softdevice" -I"/Users/Eliot/dev/nrf51822/Include/app_common" -I"/Users/Eliot/dev/nrf51822/Include/ble/ble_services" -I"../" -I"/Users/Eliot/dev/nrf51822/Include" -I"/Users/Eliot/dev/nrf51822/Include/gcc" -I"/Users/Eliot/dev/nrf51822/Include/ext_sensors" -M ../main.c -MF "_build/main.d" -MT _build/main.o </code></pre> <p>Screenshots for my CDT project config for includes, symbols and the tool chain are here:</p> <p><a href="https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_includes.png" rel="nofollow">https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_includes.png</a> <a href="https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_symbols.png" rel="nofollow">https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_symbols.png</a> <a href="https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_toolchain.png" rel="nofollow">https://dl.dropboxusercontent.com/u/12173473/screenshot_cdt_toolchain.png</a></p> <p>I'm not using a toolchain because my project started out as the sample CDT project from the hardware manufacturer (Nordic Semiconductor) and that project also had no toolchain configured. To be honest, I doubt CDT is finding the right gcc executable.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload