Results 1 to 5 of 5

Thread: Where specify the path for #include files in NIOS II Eclipse

  1. #1
    Join Date
    Aug 2012
    Location
    Switzerland
    Posts
    142
    Rep Power
    1

    Default Where specify the path for #include files in NIOS II Eclipse

    Hello,

    I'm new in NIOS development tools and apologize in advance for probably silly question.
    So, the question is: How to take into account the .h files that are referenced (by #include statements) in the source code. I suppose that there are 2 options:
    • Add these files in the application directory tree (right-clicking on the project I didn't find respective option)
    • Add the path to these .h files somewhere in the project option (where exactly ? because exploring project options I didn't find an option for specifying path for .h files)


    Here, for example, the snapshot from a simple project, taken from the book "Embedded SoPC design with NIOS II processor and VERILOG examples".
    The compilation errors are related to unrecognized types alt_u8, alt_u32, that are declared here:
    C:\altera\15.1\ip\altera\nios2_ip\altera_nios2\HAL \inc\alt_types.h

    Thanks in advance.

    Attached Images Attached Images

  2. #2
    Join Date
    Aug 2012
    Location
    Switzerland
    Posts
    142
    Rep Power
    1

    Default Re: Where specify the path for #include files in NIOS II Eclipse

    Finally I've found the location where the path to .h file must be specified.
    Here it is: Project-->Settings-->C/C++ General-->Paths and Symbols-->Includes tab.
    Here I've added the location (button Add...) to .h files: C:\altera\15.1\nios2eds\components\altera_nios2\HA L\inc.
    After compilation this path appeared in the project "Includes" folder.
    Nevertheless the compilation failed: an error is found in the source file alt_main.c (please see the screenshot below).

    Any ideas ?

    Thanks.

    Eclipse_NIOS_led1_application_building_errors.JPG

  3. #3
    Join Date
    Aug 2012
    Location
    Switzerland
    Posts
    142
    Rep Power
    1

    Default Re: Where specify the path for #include files in NIOS II Eclipse

    Resolved,

    One needs to add the main application source file (where the function main is located) in elaboration process.
    Referring to the screenshot below, one should right-click on the source file and click on "Add to NIOS II build".
    After this the application is built without errors.

    Eclipse_NIOS_led1_application_building_errors_resolved.JPG

  4. #4
    Join Date
    Aug 2012
    Location
    Switzerland
    Posts
    142
    Rep Power
    1

    Default Re: Where specify the path for #include files in NIOS II Eclipse

    Here is build result without errors (with added source file to build process) - .elf file is generated.
    Eclipse_NIOS_led1_application_building_errors_resolved(1).JPG

  5. #5
    Join Date
    Sep 2016
    Posts
    36
    Rep Power
    1

    Default Re: Where specify the path for #include files in NIOS II Eclipse

    Try main application source file (where the function main is located) in elaboration process.

Similar Threads

  1. Problem with include path under Nios-II
    By jylo in forum General Software Forum
    Replies: 0
    Last Post: May 17th, 2016, 05:21 AM
  2. Eclipse not finding include files.
    By DocDay5 in forum General Software Forum
    Replies: 1
    Last Post: February 9th, 2016, 02:11 PM
  3. (Eclipse) How to add directories to GCC include path
    By Darren in forum General Software Forum
    Replies: 14
    Last Post: March 23rd, 2012, 02:17 AM
  4. include nios software files to rbf
    By domtheron in forum General Discussion Forum
    Replies: 0
    Last Post: November 16th, 2011, 05:48 AM
  5. include path problem in nios 9.1
    By chenq918 in forum Nios Forum
    Replies: 2
    Last Post: November 12th, 2010, 06:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •