how to create a static library1. Step (1)
Select A+ icon to create a static library of project.
Attachment:
A+.JPG [ 17.85 KiB | Viewed 7263 times ]
2. Step (2)
Modify chip profile window of options.
Attachment:
Chip profile.JPG [ 134.33 KiB | Viewed 7263 times ]
3. Step (3)
Input project name, select project to sataic library and check Toolchain.
Attachment:
C project.JPG [ 65.14 KiB | Viewed 7262 times ]
4. Step (4)
Demo project will show on project explorer window.Than create a new source file as below.
Attachment:
Source File.JPG [ 103.43 KiB | Viewed 7262 times ]
5. Step(5)
Input Source file name.
Attachment:
Source file name.JPG [ 59.14 KiB | Viewed 7262 times ]
6. Step (6)
Create your program in source file.
Attachment:
Create program.JPG [ 37.83 KiB | Viewed 7262 times ]
7. Step (7)
Select Build project icon to build demo project.
Attachment:
build project.JPG [ 51.13 KiB | Viewed 7262 times ]
8. Step (8)
Generate a libdemo.a of static library file under demo project this Debug folder.
Attachment:
output libdemo.JPG [ 74.26 KiB | Viewed 7262 times ]
How to use static library1. Step (1)
Select A+ icon than modify chip profile.
Attachment:
A+.JPG [ 17.85 KiB | Viewed 7263 times ]
Attachment:
Use chip profile.JPG [ 151.24 KiB | Viewed 7262 times ]
2. Step (2)
Modify C project option.
1.Inpute project name "use demo" in the project field.
2.Project type select Andes excupetable project type of Hellow World ANSI C project.
3. Check Toolchain and click Finish icon.
Attachment:
use C project.JPG [ 126.63 KiB | Viewed 7262 times ]
3. Step (3)
Copy static library libdemo.a file paste to use demo project.
Attachment:
use copy a file.JPG [ 62.43 KiB | Viewed 7262 times ]
4. Step (4)
Add a new header file in the use demo project.
Attachment:
use header file.JPG [ 98.75 KiB | Viewed 7262 times ]
5. Step (5)
Include static library "libdemo.a" file into use demo project.
Select Target Configuration icon into setting window.
Attachment:
use target config.JPG [ 76.15 KiB | Viewed 7262 times ]
Select "Settings" and select Andes C Linker of Libraries icon.
Attachment:
use lib setting.JPG [ 159.1 KiB | Viewed 7262 times ]
Select Static library file of path.
1.Select + icon as following red mark 1.
2.Select Workspace icon as red mark 2.
3.Select use demo project this folder in red mark 3. (Because libdemo.a of path is under use demo folder).
Attachment:
use path.JPG [ 219.52 KiB | Viewed 7262 times ]
6. Step (6)
Select Libraries (-l) of + icon to input static file name.
We don't key in static file of full name"libdemo.a" into field. We just need to key in "Demo" into this field.
Attachment:
use add liber file.JPG [ 163.67 KiB | Viewed 7262 times ]
Attachment:
use path2.JPG [ 159.76 KiB | Viewed 7262 times ]
7. Step (7)
Modify use demo.c file to use static library.
Attachment:
use add program.JPG [ 135.76 KiB | Viewed 7262 times ]
8. Step (8)
Select use demo project to build project.
Attachment:
use build project.JPG [ 167.27 KiB | Viewed 7262 times ]
9. Step (9)
Select use demo project to run Debug as/ C/C++Application.
Attachment:
use debug as.JPG [ 124.74 KiB | Viewed 7262 times ]
Using step into founction to run program and running static library of resault show on up right corner of window.
Attachment:
use resault.JPG [ 251.69 KiB | Viewed 7262 times ]