Select Nios II Library
Choose location, so the library file is independent, and if you choose Make library depend on a BSP will rely on the BSP, if the BSP is deleted, the new project will be compiled error.
Add C source files and H header files
Then build project
Then create a new project:
File->nios II application and BSP from Template
Then add the search path to the library file in the project:
Right-click the project file->properties-> expand nios II Application properties-> Select Nios Application Paths
Add the Library project top-level file in library projects, add the directory containing the library header files to the application include directories, and in the Application library directories Add a directory containing the. A file in the library name, as shown in
Then select OK,
Finally compile the project file, build project.