下载最新版keil软件(4.71.2.0),只改了一个文件,选择部分编译,发现keil全部编译所有文件,速度慢死了。还有就是用source insight 修改后每次keil都报警,需重新加载确认!
(1) Edit--》configuration,单击,然后选择相关的配置选项,如图
(2) 部分编译成全编译问题 。去掉勾选"USE-Cross_Module Optimization"
下面解释下原因吧,英文水平有限。参考前辈们的博文 http://blog.csdn.net/yangtalent1206/article/details/8493120
MDK Compiler Optimizations
• Cross- Module
Optimization takes information from a prior build and uses it to place UNUSED functions into their own ELF section in the corresponding object file.
This option is also known as Linker Feedback, and requires you to build your application twice to take advantage of it for reduced code size.
Cross-Module Optimization has been shown to reduce code size, by removing unused functions from your application.
It can also improve the performance of your application, by allowing modules to share inline code.
“最优化”从预编译来获取信息,并且通过它将未使用的函数放到分割的切片模块所对应的对象文件里。
这个选项是链接器的反馈,并且它需要编译你的应用文件两次来获取较小的优化代码。它通过移除未使用的函数来减小代码的大小,同时也通过允许模块间共享内敛代码来提升该性能。
• The M icroLIB C library
has been optimized to reduce the size of embedded applications. It is a subset of the ISO
standard C runtime library, and offers a tradeoff between functionality and code size. Some of the standard C library
functions such as memcpy() are slower, while some features of the default library are not supported. Unsupported
features include:
o Operating system functions e.g. abort(), exit(), time(), system(), getenv(),
o Wide character and multi-byte support e.g. mbtowc(), wctomb()
o The stdio file I/O function, with the exception of stdin, stdout and stderr
o Position-independent and thread -safe code
Use the MicroLIB C library for applications where overall performance can be traded off against the need to reduce code
size and memory cost.
这个选项用来优化嵌入式应用的大小。它是ISO标准C 运行库里的一个子集,提供代码大小和函数功能性间来选择权衡。一些标准C里的函数如memcpy内存拷贝比该库慢,然而它也缺少一些功能并且一些库也不支持。
(3)编译keil工程时,报编译大小超出范围,原因是没破解,FILE-->LICENCE MANGEMENT .......破解就好了