KDS集成开发环境创建静态库的方法.PDFVIP

  • 16
  • 0
  • 约2.44千字
  • 约 8页
  • 2019-02-15 发布于天津
  • 举报
KDS集成开发环境创建静态库的方法.PDF

KDS 集成开发环境创建静态库的方法 Kinetis Design Studio 3.0.0 集成开发环境较CodeWarrior10.x 在使用新项目向导时少了 可供用户选择该项目为Application 还是library 的选项 (下图红框内是CodeWarrior10.6 的 项目类型选项)。这就使得原本用惯了CW10.x 的用户在转而使用KDS 后,不知道应该如 何创建Library 类型的项目。故在此与大家分享使用KDS3.0.0 集成开发环境创建静态库 (Static Library)的方法。 CW10.6 项目类型选择界面 1 Step1:创建新项目 在KDS3.0 集成开发环境下点击File New Kinetis Project 创建新项目 输入新项目名称,并点击Next 2 选择芯片型号,并点击Finish 至此就完成了使用KDS 创建新项目的操作。 3 Step2:改成静态库类型 在KDS 的菜单栏点击Project Properties C/C++ Build Settings Build Artifact 里将项 目类型从“Executable”改成“Static Library”。 Application Project Type Static Library Project Type 名为KL25_Lib 的Artifact 类型由“Executable”改成“Static Library”后,经过Build 生成的 输出文件将自动调整以lib 为前缀和a 为扩展名。 (例如:libKL25_Lib.a) 4 Step3:删除不需要的文件 这一步将删除项目向导根据默认的application 项目类型增加进来的文件 (使用Delete 键或右键单击文件选择Delete): 1. Linker Files: the library does not need a linker file, the library is a collection of object files only. 2. Startup Code: the startup code belongs to the application, usually the library does not provide the startup code. 3. Debugger configuration and launch configuration files: we are debugging the application from the application project, not with the library project. 4. Main.c: typically the library consists of library modules, and does not have a main(). So we can remove this file too. 5 Step4:增加库函数 此处为自定义的库增加一个简单的函数作为演示: 1. 左键单击选择Source 并在KDS 菜单栏点击File New Source File 2. 在Source file 栏里输入文件名,在Template 栏里将Default C source template 选为 模板后单击Finish 完成。 6 3. 在新建的c 文

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档