I have created a managed library project and use it in my application successfully basing on the following instructions:
Create your managed library project and your C/C++ application project.
Reference the managed library project from your C/C++ application project:
a) Right-click your project in the C/C++ Projects view and choose Properties.
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif Select Project References.
c) Select the managed library project you want to reference.
This step ensures that your managed library project builds before your C/C++ application project. It also ensures you can easily step into the managed library code when debugging your application project.
Set up the linker options so your C/C++ application project can locate your library. The C/C++ library of a managed library project is not automatically detected when you reference the project; it has to be explicitly added.
a) In the Properties dialog box, select C/C++ Build.
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif Select the Tool Settings tab.
c) Select Linker > General.
d) In the Libraries section, click Add Library and type the name of the managed library project. Do not press the Browse... button.
e) In the Library Paths section, click Add Library Path and add the path to the *.a library file. The library path should include the Debug or Release folder. Note that you will have to update the library path if you change the configuration (i.e. Release or Debug) of the managed library project.
Set up the include paths to locate headers from your Managed Library project. If your managed library project includes header files you would like to access from your C/C++ application project, you need to specifically enter the paths to the header files.
a) On the Tool Settings tab, select Nios II Compiler > General.
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif In the Include Paths section, click Add Include Path and add the full or relative path to the folder containing the header files.
Click OK to close the Properties dialog box.
The library project created mylib.a for me, and I hope use it directly.
So I copy it to my application directory(C:/altera/OSD_FINAL/JaidNiosOSD/software/TestCPP), then I edit linker in project property:
linker->General->Libraries: mylib
linker->General->Library Paths: C:/altera/OSD_FINAL/JaidNiosOSD/software/TestCPP
But the compiler report that "cannot find -lmylib".
Anybody help,
David