Search code examples
cnfc

Error recompiling explore NFC


While recompiling we ran into this error:

gcc basic.c -o basic $(pkg-config --cflags --libs glib-2.0) -I/usr/include/neardal -std=c11

/tmp/ccUdc8fR.o: In function `start_polling':
basic.c:(.text+0x30): undefined reference to `neardal_get_adapters'
basic.c:(.text+0x64): undefined reference to `neardal_error_get_text'
basic.c:(.text+0x108): undefined reference to `neardal_get_adapter_properties'
basic.c:(.text+0x134): undefined reference to `neardal_error_get_text'
basic.c:(.text+0x198): undefined reference to `neardal_set_adapter_property'
basic.c:(.text+0x1b8): undefined reference to `neardal_error_get_text'
basic.c:(.text+0x214): undefined reference to `neardal_start_poll_loop'
basic.c:(.text+0x234): undefined reference to `neardal_error_get_text'
basic.c:(.text+0x260): undefined reference to `neardal_free_adapter'
basic.c:(.text+0x2a0): undefined reference to `neardal_free_array'
/tmp/ccUdc8fR.o: In function `record_found':
basic.c:(.text+0x7f8): undefined reference to `neardal_get_record_properties'
basic.c:(.text+0x810): undefined reference to `neardal_error_get_text'
basic.c:(.text+0x8f4): undefined reference to `neardal_free_record'
basic.c:(.text+0x924): undefined reference to `neardal_free_record'
/tmp/ccUdc8fR.o: In function `tag_found':
basic.c:(.text+0x978): undefined reference to `neardal_get_tag_properties'
basic.c:(.text+0x990): undefined reference to `neardal_error_get_text'
basic.c:(.text+0xa54): undefined reference to `neardal_tag_write'
basic.c:(.text+0xa6c): undefined reference to `neardal_error_get_text'
basic.c:(.text+0xab8): undefined reference to `neardal_free_tag'
/tmp/ccUdc8fR.o: In function `device_found':
basic.c:(.text+0xb08): undefined reference to `neardal_get_dev_properties'
basic.c:(.text+0xb20): undefined reference to `neardal_error_get_text'
basic.c:(.text+0xb54): undefined reference to `neardal_free_device'
basic.c:(.text+0xbd4): undefined reference to `neardal_dev_push'
basic.c:(.text+0xbec): undefined reference to `neardal_error_get_text'
/tmp/ccUdc8fR.o: In function `main':
basic.c:(.text+0x10f0): undefined reference to `neardal_set_cb_tag_found'
basic.c:(.text+0x1100): undefined reference to `neardal_set_cb_dev_found'
basic.c:(.text+0x1110): undefined reference to `neardal_set_cb_record_found'
basic.c:(.text+0x1120): undefined reference to `neardal_set_cb_tag_lost'
basic.c:(.text+0x1130): undefined reference to `neardal_set_cb_dev_lost'
basic.c:(.text+0x119c): undefined reference to `neardal_free_record'
collect2: error: ld returned 1 exit status

Leaving this error out of the way for a second we discovered another error, In the README of neard-explorenfc-1.2 the steps from "Building from source" were followed up until the point "Create the configure script".

cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc ..

CMake Error at /usr/share/cmake-3.0/Modules/ExternalProject.cmake:1467 (message):
  error: no download info for 'NXPRDLIBLINUX' -- please specify
  existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE,
  SVN_REPOSITORY, GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND
Call Stack (most recent call first):
  /usr/share/cmake-3.0/Modules/ExternalProject.cmake:1847 (_ep_add_download_command)
  CMakeLists.txt:13 (ExternalProject_Add)


-- Configuring incomplete, errors occurred!
See also "/home/pi/Downloads/neardal-0.14-3/neard-explorenfc-1.2/build/CMakeFiles/CMakeOutput.log".

We could't find any solutions online so we're stuck at this project at the moment.
Any people who are familiar or have run into this problem? Thanks in advance!


Solution

  • You must add -lneardal to you command to link neardal library to your code.