新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > stm32教你如何編譯出LIB文件

        stm32教你如何編譯出LIB文件

        作者: 時間:2016-12-01 來源:網絡 收藏
        這個是生成LIB的技巧.也許大家在網上看到某些程序會發現,他們用這個方式來包含STM32

        的庫文件:

        本文引用地址:http://www.104case.com/article/201612/324463.htm


        而不是像DX32的例程那樣一堆C:


        那么,本技巧篇例程就是教大家怎么生成那個.LIB 的文件的.
        首先打開本程序,大家看到的整個工程就只有庫文件:


        因為這是把STM32的函數庫編譯成庫的形式,所以你只需要包含函數庫就行.
        然后注意一點,stm32f10x_conf.h 文件中,所有的include都要開放
        #include "stm32f10x_adc.h"
        #include "stm32f10x_bkp.h"
        #include "stm32f10x_can.h"
        #include "stm32f10x_crc.h"
        #include "stm32f10x_dac.h"
        #include "stm32f10x_dbgmcu.h"
        #include "stm32f10x_dma.h"
        #include "stm32f10x_exti.h"
        #include "stm32f10x_flash.h"
        #include "stm32f10x_fsmc.h"
        #include "stm32f10x_gpio.h"
        #include "stm32f10x_i2c.h"
        #include "stm32f10x_iwdg.h"
        #include "stm32f10x_pwr.h"
        #include "stm32f10x_rcc.h"
        #include "stm32f10x_rtc.h"
        #include "stm32f10x_sdio.h"
        #include "stm32f10x_spi.h"
        #include "stm32f10x_tim.h"
        #include "stm32f10x_usart.h"
        #include "stm32f10x_wwdg.h"
        #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions)
        */
        這是因為當這堆C文件編譯成*.LIB后,里面的內容將是恒定的,不能裁減的.(這是C語言的理
        念,跟編譯器什么的無關),所以我們必須開放所有H 文件,這樣編譯出來的LIB 文件才是全能
        的.這個理解,就和普通的DX32例程中包含一大堆C文件的意義是一樣的.只不過是我們先把
        庫函數那部分預先編譯成LIB 文件.


        上一頁 1 2 下一頁

        關鍵詞: stm32LIB文

        評論


        技術專區

        關閉
        主站蜘蛛池模板: 延吉市| 宁城县| 渝中区| 五常市| 南郑县| 平原县| 读书| 祁门县| 郓城县| 新野县| 冷水江市| 资中县| 常德市| 宣城市| 长乐市| 朝阳区| 和硕县| 凤庆县| 青州市| 东山县| 湘阴县| 临城县| 皮山县| 巩义市| 隆德县| 北流市| 英吉沙县| 乡城县| 禄劝| 台东市| 建湖县| 望城县| 嘉峪关市| 贵溪市| 马龙县| 庆阳市| 桦川县| 海丰县| 平顶山市| 临沂市| 明水县|