Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
2,198 Views

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. 

 

http://www.alteraforum.com/forum/attachment.php?attachmentid=13314&stc=1
0 Kudos
4 Replies
Altera_Forum
Honored Contributor I
554 Views

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\hal\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. 

 

https://www.alteraforum.com/forum/attachment.php?attachmentid=13316
Altera_Forum
Honored Contributor I
554 Views

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. 

 

https://www.alteraforum.com/forum/attachment.php?attachmentid=13317
Altera_Forum
Honored Contributor I
554 Views

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

https://www.alteraforum.com/forum/attachment.php?attachmentid=13318
Altera_Forum
Honored Contributor I
554 Views

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

Reply