Can't compile ANCS BLE example

I'm trying to compile a program for the ANCS library as described here. It returns with this error message. I am pretty sure this is a simple mistake but I can't figure out what's wrong. Am I not initializing correctly?

Arduino: 1.0.6 (Mac OS X), Board: "Arduino Duemilanove w/ ATmega328"
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master -I/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master -I/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROM -I/Applications/Arduino.app/Contents/Resources/Java/libraries/SPI -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Wire -I/Users/c474774ck/Documents/Arduino/libraries/Adafruit-GFX-Library-master -I/Users/c474774ck/Documents/Arduino/libraries/Adafruit_SSD1306-master -I/Users/c474774ck/Documents/Arduino/libraries/RTClib-master /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build4685235541044252843.tmp/Watch.cpp -o /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build4685235541044252843.tmp/Watch.cpp.o
Watch.ino:21:21: warning: lib_aci.h: No such file or directory
In file included from /Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_data_source.h:8,
from Watch.ino:3:
/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master/aci.h:216: error: 'uint16_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master/aci.h:220: error: 'uint16_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master/aci.h:224: error: 'uint16_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master/aci.h:226: error: 'uint16_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master/aci.h:293: error: 'uint8_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master/aci.h:294: error: 'uint8_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master/aci.h:303: error: 'uint8_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/arduino-nrf8001-master/aci.h:304: error: 'uint8_t' does not name a type
Watch.ino:54: warning: only initialized variables can be placed into program memory area
Watch.ino: In function 'void setup()':
Watch.ino:89: warning: only initialized variables can be placed into program memory area
Watch.ino:89: warning: only initialized variables can be placed into program memory area
/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/pack_lib.h: At global scope:
/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/pack_lib.h:128: warning: 'size_t pack(unsigned char*, const char*, ...)' defined but not used
/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/pack_lib.h:133: warning: 'size_t unpack(const unsigned char*, const char*, ...)' defined but not used

Basically I'm trying to compile and it's not finding the aci.h and hal_platform.h. The header in question is the avr_nrf_ancs_library-master/ancs_data_source.h These header files are found in /Adafruit_nRF8001-master/utility

I attempted to fix the problem by relocating some of the files into the directory but this only creates more errors.

wiltors42:
… I can’t figure out what’s wrong. Am I not initializing correctly?

Can’t tell. Got code? It’s unlikely that we’ll comment on it accurately if you don’t show it to us.

Having said that, my memory tells me that there’s a quirk in the IDE. When I see well-known datatypes described as undefined, I put some other, pointless declaration statement ahead of the rest of the code - something like, “int dummy;” and it often clears it up. I think that there’s something peculiar about the way that the IDE processes its own included files - that it puts them right after the first statement in the sketch that isn’t a comment or a compiler directive. I think that the code that defines uint8_t is included somewhere below the earlier included files, and, wherever they reference those types, the compiler throws an error.

If the compiler directive that includes your libraries comes before the first statement that isn’t a compiler directive or comment, that could be it. But that’s just a guess.

I'm even just trying to get the example program for the BLE library to work. The sketch is called ble_A_Hello_World_Program and the code and errors are in this pastebin. I've been at this for a couple of days and I've never had this much trouble getting an Arduino library to work out of the box. :o

As a personal favor to me, please just try adding this line at the very top of your sketch:

int dummy;

Then tell us whether it helped. If it does, someone more knowledgeable than me will explain why.

It unfortunately did not change anything.

The sketch is called ble_A_Hello_World_Program and the code and errors are in this pastebin

The forum allows you to attach your code. There was no reason to toss it in the rubbish bin.

Well, I tried to post the code but it exceeded the maximum allowed length. Does anybody know why this library is not compiling??

Arduino: 1.0.6 (Mac OS X), Board: "Arduino Duemilanove w/ ATmega328"
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Applications/Arduino.app/Contents/Resources/Java/libraries/SPI -I/Users/c474774ck/Documents/Arduino/libraries/BLE -I/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/ble_A_Hello_World_Program.cpp -o /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/ble_A_Hello_World_Program.cpp.o 
ble_A_Hello_World_Program.ino: In function 'void aci_loop()':
ble_A_Hello_World_Program.ino:325: warning: enumeration value 'ACI_DEVICE_INVALID' not handled in switch
ble_A_Hello_World_Program.ino:325: warning: enumeration value 'ACI_DEVICE_TEST' not handled in switch
ble_A_Hello_World_Program.ino:325: warning: enumeration value 'ACI_DEVICE_SLEEP' not handled in switch
ble_A_Hello_World_Program.ino:317: warning: enumeration value 'ACI_EVT_INVALID' not handled in switch
ble_A_Hello_World_Program.ino:317: warning: enumeration value 'ACI_EVT_ECHO' not handled in switch
ble_A_Hello_World_Program.ino:317: warning: enumeration value 'ACI_EVT_BOND_STATUS' not handled in switch
ble_A_Hello_World_Program.ino:317: warning: enumeration value 'ACI_EVT_DATA_ACK' not handled in switch
ble_A_Hello_World_Program.ino:317: warning: enumeration value 'ACI_EVT_DISPLAY_PASSKEY' not handled in switch
ble_A_Hello_World_Program.ino:317: warning: enumeration value 'ACI_EVT_KEY_REQUEST' not handled in switch
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/SPI/SPI.cpp.o
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/aci_queue.cpp.o
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/aci_setup.cpp.o
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/acilib.cpp.o
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/hal_aci_tl.cpp.o
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/lib_aci.cpp.o
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/avr_nrf_ancs_library-master/ancs_data_source.cpp.o
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/avr_nrf_ancs_library-master/ancs_notification.cpp.o
  Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/avr_nrf_ancs_library-master/ancs_notification_list.cpp.o
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Applications/Arduino.app/Contents/Resources/Java/libraries/SPI -I/Users/c474774ck/Documents/Arduino/libraries/BLE -I/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master -I/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/utility /Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_notification_source.cpp -o /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/avr_nrf_ancs_library-master/ancs_notification_source.cpp.o 
In file included from /Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_notification_source.cpp:3:
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:265: error: 'uint16_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:269: error: 'uint16_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:273: error: 'uint16_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:275: error: 'uint16_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:342: error: 'uint8_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:343: error: 'uint8_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:346: error: size of array 'aci_tx_data_t_assert_size_t' is negative
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:354: error: 'uint8_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:355: error: 'uint8_t' does not name a type
/Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:358: error: size of array 'aci_rx_data_t_assert_size_t' is negative
/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_notification_source.cpp: In function 'bool ancs_send_buffered_command()':
/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_notification_source.cpp:43: error: 'lib_aci_send_data' was not declared in this scope

I went to your link. I downloaded the ANCS library. I saw the note in the Install section about needing to install the other library, so I downloaded and installed the BLE library. I opened an example, and compiled. I got:

Binary sketch size: 26,492 bytes (of a 258,048 byte maximum)

Hm. You're talking about the Nordic Bluetooth library, right? I did install that library but maybe I didn't do it properly. :confused: thank you I'll keep trying.