title: Eclipse CDT error: "Symbol 'XXX' could not be resolved"
body: <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 <code>main.c</code>, this function uses a macro, <code>APP_BUTTON_INIT</code>:</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 <code>APP_BUTTON_INIT</code> macro is defined in <code>app_button.h</code> 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, <code>app_button.h</code>:</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 -&gt; Index -&gt; 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 <code>Makefile</code> is this (this works):</p>
  <pre><code>mkdir _build
  &quot;/Users/Eliot/dev/gcc-arm/bin/arm-none-eabi-gcc&quot; -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&quot;/Users/Eliot/dev/nrf51822/Include/ble&quot; -I&quot;/Users/Eliot/dev/nrf51822/Include/ble/softdevice&quot; -I&quot;/Users/Eliot/dev/nrf51822/Include/app_common&quot; -I&quot;/Users/Eliot/dev/nrf51822/Include/ble/ble_services&quot; -I&quot;../&quot; -I&quot;/Users/Eliot/dev/nrf51822/Include&quot; -I&quot;/Users/Eliot/dev/nrf51822/Include/gcc&quot; -I&quot;/Users/Eliot/dev/nrf51822/Include/ext_sensors&quot; -M ../main.c -MF &quot;_build/main.d&quot; -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 noreferrer">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 noreferrer">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 noreferrer">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>