Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12744 Discussions

How to Properly Include a Custom Library in Quartus Prime Nios II Project?

adamShiau
Novice
704 Views

Hi,

I'm using Quartus Prime 18.1 to develop an FPGA project with Nios II.

I have written a UART library (uart.c and uart.h) that I want to include in my main code main.c.

Currently, the way I add the library to the project is shown in the attached picture.

However, using this method, I have to include both "uart.h" and "uart.c" in main.c to compile it correctly.

If I only include "uart.h", the methods defined in uart.c are not recognized by the compiler.

I would like to know how to properly set the library path so that I only need to include the header file.

Thank you!

 

Adam Shiau

 

adamShiau_0-1737544731288.png

 

 

 

 

0 Kudos
1 Solution
JingyangTeh_Altera
601 Views

Hi


After adding the .c and .h into the project the make file should be update.

Could you check if the .h and .c is added into the make file of you project?

If not you would need to add them in manually.


You could check the line below in the make file:


# List of include directories for -I compiler option (-I added when used). 

# Includes the BSP. 

ALT_INCLUDE_DIRS := <File path here>

 

# List of library directories for -L linker option (-L added when used). 

# Includes the BSP. 

ALT_LIBRARY_DIRS := <File path here>



Regards

Jingyang, Teh


View solution in original post

0 Kudos
3 Replies
JingyangTeh_Altera
602 Views

Hi


After adding the .c and .h into the project the make file should be update.

Could you check if the .h and .c is added into the make file of you project?

If not you would need to add them in manually.


You could check the line below in the make file:


# List of include directories for -I compiler option (-I added when used). 

# Includes the BSP. 

ALT_INCLUDE_DIRS := <File path here>

 

# List of library directories for -L linker option (-L added when used). 

# Includes the BSP. 

ALT_LIBRARY_DIRS := <File path here>



Regards

Jingyang, Teh


0 Kudos
JingyangTeh_Altera
569 Views

Hi


Do you have any update on this case?


Regards

Jingyang, Teh


0 Kudos
JingyangTeh_Altera
525 Views

Hi


As we do not receive any response from you on the previous question/reply/answer that we have provided. Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


Regards

Jingyang, Teh


0 Kudos
Reply