Andes Workshop http://forum.andestech.com/ |
|
How to create a static library and use it (English) http://forum.andestech.com/viewtopic.php?f=23&t=822 |
Page 1 of 1 |
Author: | jonathan [ Tue Apr 08, 2014 6:49 pm ] | ||
Post subject: | How to create a static library and use it (English) | ||
how to create a static library 1. Step (1) Select A+ icon to create a static library of project. Attachment: A+.JPG [ 17.85 KiB | Viewed 7178 times ] 2. Step (2) Modify chip profile window of options. Attachment: 3. Step (3) Input project name, select project to sataic library and check Toolchain. Attachment: C project.JPG [ 65.14 KiB | Viewed 7177 times ] 4. Step (4) Demo project will show on project explorer window.Than create a new source file as below. Attachment: 5. Step(5) Input Source file name. Attachment: 6. Step (6) Create your program in source file. Attachment: 7. Step (7) Select Build project icon to build demo project. Attachment: 8. Step (8) Generate a libdemo.a of static library file under demo project this Debug folder. Attachment: How to use static library 1. Step (1) Select A+ icon than modify chip profile. Attachment: A+.JPG [ 17.85 KiB | Viewed 7178 times ] Attachment: 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: 3. Step (3) Copy static library libdemo.a file paste to use demo project. Attachment: 4. Step (4) Add a new header file in the use demo project. Attachment: 5. Step (5) Include static library "libdemo.a" file into use demo project. Select Target Configuration icon into setting window. Attachment: Select "Settings" and select Andes C Linker of Libraries icon. Attachment: 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: 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: Attachment: 7. Step (7) Modify use demo.c file to use static library. Attachment: 8. Step (8) Select use demo project to build project. Attachment: 9. Step (9) Select use demo project to run Debug as/ C/C++Application. Attachment: Using step into founction to run program and running static library of resault show on up right corner of window. Attachment:
|
Page 1 of 1 | All times are UTC + 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |