Andes Workshop

It is currently Fri Mar 29, 2024 4:08 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to create a static library and use it (English)
PostPosted: Tue Apr 08, 2014 6:49 pm 
Offline

Joined: Thu Apr 03, 2014 4:27 pm
Posts: 43
how to create a static library
1. Step (1)
Select A+ icon to create a static library of project.
Attachment:
A+.JPG
A+.JPG [ 17.85 KiB | Viewed 7136 times ]

2. Step (2)
Modify chip profile window of options.
Attachment:
Chip profile.JPG
Chip profile.JPG [ 134.33 KiB | Viewed 7136 times ]

3. Step (3)
Input project name, select project to sataic library and check Toolchain.
Attachment:
C project.JPG
C project.JPG [ 65.14 KiB | Viewed 7135 times ]

4. Step (4)
Demo project will show on project explorer window.Than create a new source file as below.
Attachment:
Source File.JPG
Source File.JPG [ 103.43 KiB | Viewed 7135 times ]

5. Step(5)
Input Source file name.
Attachment:
Source file name.JPG
Source file name.JPG [ 59.14 KiB | Viewed 7135 times ]

6. Step (6)
Create your program in source file.
Attachment:
Create program.JPG
Create program.JPG [ 37.83 KiB | Viewed 7135 times ]

7. Step (7)
Select Build project icon to build demo project.
Attachment:
build project.JPG
build project.JPG [ 51.13 KiB | Viewed 7135 times ]

8. Step (8)
Generate a libdemo.a of static library file under demo project this Debug folder.
Attachment:
output libdemo.JPG
output libdemo.JPG [ 74.26 KiB | Viewed 7135 times ]



How to use static library
1. Step (1)
Select A+ icon than modify chip profile.
Attachment:
A+.JPG
A+.JPG [ 17.85 KiB | Viewed 7136 times ]

Attachment:
Use chip profile.JPG
Use chip profile.JPG [ 151.24 KiB | Viewed 7135 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
use C project.JPG [ 126.63 KiB | Viewed 7135 times ]

3. Step (3)
Copy static library libdemo.a file paste to use demo project.
Attachment:
use copy a file.JPG
use copy a file.JPG [ 62.43 KiB | Viewed 7135 times ]

4. Step (4)
Add a new header file in the use demo project.
Attachment:
use header file.JPG
use header file.JPG [ 98.75 KiB | Viewed 7135 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
use target config.JPG [ 76.15 KiB | Viewed 7135 times ]

Select "Settings" and select Andes C Linker of Libraries icon.
Attachment:
use lib setting.JPG
use lib setting.JPG [ 159.1 KiB | Viewed 7135 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
use path.JPG [ 219.52 KiB | Viewed 7135 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
use add liber file.JPG [ 163.67 KiB | Viewed 7135 times ]

Attachment:
use path2.JPG
use path2.JPG [ 159.76 KiB | Viewed 7135 times ]

7. Step (7)
Modify use demo.c file to use static library.
Attachment:
use add program.JPG
use add program.JPG [ 135.76 KiB | Viewed 7135 times ]

8. Step (8)
Select use demo project to build project.
Attachment:
use build project.JPG
use build project.JPG [ 167.27 KiB | Viewed 7135 times ]

9. Step (9)
Select use demo project to run Debug as/ C/C++Application.
Attachment:
use debug as.JPG
use debug as.JPG [ 124.74 KiB | Viewed 7135 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
use resault.JPG [ 251.69 KiB | Viewed 7135 times ]


Attachments:
use +icon.jpg
use +icon.jpg [ 2.05 KiB | Viewed 7135 times ]
Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group