This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM DS-5 Compiler issue: fatal error: No such file or directory

Dear all,
I'm tring programing with ARM DS-5 on Zedboard, I just made a simple project to test Bluetooth function.

In this project some bluetooth header files were needed, I copied the header files to "DS-5 install path/include/", but DS-5 compiler shows error.

**** Build of configuration Default for project Bluetooth_Scan1 ****

make all
arm-linux-gnueabihf-gcc -c -O1 -g -fno-omit-frame-pointer -marm -march=armv4t -mfloat-abi=soft bluetoothscan.c -o bluetoothscan.o
bluetoothscan.c:12:33: fatal error: bluetooth/bluetooth.h: No such file or directory
compilation terminated.
make: *** [bluetoothscan.o] Error 1

**** Build Finished ****

So I copied the source code file (bluetoothscan.c file) to Zedboard, with GCC compiler.

#gcc -o bluetoothscan bluetoothscan.c -lbluetooth

it seems ok and the program works fine.

Maybe I just miss something?

  • Hi williamtai,

    If i am not wrong it's your project dependencies, i hope so it will help you.

    To Add "Path, Symbol, Library path" etc to work

    • Project Properties(right click the desire project in project explorer) -> C/C++ General -> Paths and Symbols

    OR

    • Project Properties-> C/C++ Build -> Settings-> ARM C COMPILER-> Includes

    For more info:

    Adding "Path, Symbol, Library path"

    Eclipse Paths.pngARM Path.png

    and I always prefer relative path

    e.g.

    "${workspace_loc:/PROJECTNAME/FOLDER/Include}"

    Thanks

  • Hi asi,

    Thanks for reply.

    As the screenshot (be attached file in original post), library path had been setup in

    • Project Properties(right click the desire project in project explorer) -> C/C++ General -> Paths and Symbols

    you can check it in Project Explorer on the left side.

    Most of library works fine, only bluetooth library can not be searched.

  • Hi,

    Sorry i didn't notice the "arm-linux-gnueabihf-gcc"

    >> I copied the header files to "DS-5 install path/include/"

    Each include path is set in MAKEFILE of your project.

    e.g.

    CC_INCLUDE = \

        -I$(Project_Name) \

        -I$(Project_Name)/libgames-support \

        -I$(SYSROOT)/usr/include/ \

        -I$(SYSROOT)/usr/include/glib-2.0 \

        -I$(SYSROOT)/usr/include/gtk-2.0 \

        -I$(SYSROOT)/usr/include/cairo \

        -I$(SYSROOT)/usr/include/pango-1.0 \

        -I$(SYSROOT)/usr/include/atk-1.0 \

        -I$(SYSROOT)/usr/include/gdk-pixbuf-2.0   

    thanks

  • Hi,

    I changed Makefile, add -I option, copied the bluetooth library to 'C:\bluetooth' for test.

    INCLUDE = \

         -IC:\bluetooth \

    **** Build of configuration Default for project Bluetooth_Scan1 ****

    make all

    arm-linux-gnueabihf-gcc -c -O1 -g -fno-omit-frame-pointer -marm -march=armv4t -mfloat-abi=soft -IC:\bluetooth  bluetoothscan.c -o bluetoothscan.o

    bluetoothscan.c:19:33: fatal error: bluetooth/bluetooth.h: No such file or directory

    compilation terminated.

    make: *** [bluetoothscan.o] Error 1

    **** Build Finished ****

  • I just changed the path of bluetooth library, deleted the "arm-linux-gnueabihf-gcc" option '-IC:\bluetooth'.

    #include <C:\bluetooth\bluetooth.h>

    #include <C:\bluetooth\hci.h>

    #include <C:\bluetooth\hci_lib.h>

    and compiler works!

  • Because the #include looks like <bluetooth/bluetooth.h> you need to give -I the parent directory of 'bluetooth' (e.g. -IC:\ or -I.../From_Zedboard)

    [Also, using #include "bluetooth/bluetooth.h" would be technically better that #include <bluetooth/bluetooth.h> since the file is not from the C Standard.  But I realise that it's not your file to change.]

  • Thanks for reply, it really helps me.

    I changed Makefile, add option "-IC:\" since the bluetooth library (for test) in "C:\bluetooth", it works!

    I changed the option to "-I.../From_Zedboard" and it doesn't work.

    Makefile is located in project folder "C:\DS-5 Workspace\Bluetooth_Scan1".

    "-I.../From_Zedboard" means which path?

     

    I really confused about this.

  • "-I.../From_Zedboard" means which path?

    In your original .png you show that you have a folder "C:/Program Files/DS-5/includes/From_Zedboard"; I was just abbreviating the path as ..., you'll have to spell it out; sorry to cause confusion.


    [Please mark the question answered if it is.]