請問如何用code composer 裡的 mk30編譯lib檔 |
尚未結案
|
kin0525
一般會員 發表:3 回覆:3 積分:1 註冊:2005-03-09 發送簡訊給我 |
我是了很多指令 但都不行編譯
請問編譯所謂的lib檔有什麼限制嗎
按照下面的使用說明 編譯
但都會出現
無法編譯的錯誤 The general syntax for invoking the library utility is:
mk30 [options] src_arch1 [–lobj.lib1] [src_arch2 [–lobj.lib2]]
mk30 is the command that invokes the utility.
options can appear anywhere on the command line or in a command file.
(Options are discussed in Section 6.2 and below.)
src_arch is the name of a source archive file. For each source archive
named, mk30 will build an object library according to the runtime
model specified by the command line options.
–l obj.lib is the optional object library name. If you do not specify a name
for the library, mk30 uses the name of the source archive and
appends a .lib suffix. For each source archive file specified, a corresponding
object library file is created. An object library cannot
be built from multiple source archive files.
The mk30 utility runs the shell program cl30 on each source file in the archive
to either compile or assemble it. It then collects all the object files into the output
library. All the tools must be in your PATH. The utility ignores and disables
the environment variables TMP, C_OPTION, and C_DIR.
Library Utility Specific Options
Most of the options that are included on the command line correspond directly
to options of the same name used with the compiler and assembler. The following
options apply only to the library-build utility.
––c extracts C source files contained in the source archive from the
library and leaves them in the current directory after the utility has
completed execution.
––h instructs mk30 to use header files contained in the source archive
and leave them in the current directory after the utility has completed
execution. You will probably want to use this option to install
the runtime-support header files from the rts.src archive that is
shipped with the tools.
––k instructs the mk30 utility to over-write files. By default, the utility
aborts any time it attempts to create an object file when an object
file of the same name already exists in the current directory, regardless
of whether you specified the name or the utility derived
it.
––q instructs mk30 to suppress header information (quiet).
Invoking the Library-Build Utility
6-3 Library-Build Utility
––u instructs mk30 not to use the header files contained in the source
archive when building the object library. If the desired headers are
already in the current directory, there is no reason to reinstall
them. This option also gives you some flexibility in modifying
runtime-support functions to suit your application.
––v prints progress information to the screen during execution of the
utility. Normally, the utility operates silently (no screen messages).
Example: The following command builds the standard runtime support library
as an object library named rts40r.lib. The library is compiled for the
TMS320C4x (–v40), optimized with inline function expansion (–x and –o), and
uses the register-argument runtime conventions. The example assumes that
the runtime support headers already exist in the current directory (––u).
mk30 – –u –v40 –o –x –mr rts.src –1 rts40r.lib
|
kin0525
一般會員 發表:3 回覆:3 積分:1 註冊:2005-03-09 發送簡訊給我 |
此問題我已經解決了
原來要編成lib檔
要有兩個檔案
以下是我編成執行檔的內容 @echo Creating source code archive ... @rem Add REQUIRED includes to .src
@ar30 -rquv stc32lib.src stc32.h
@ar30 -rquv stc32lib.src stdio.h @rem Add all REQUIRED source files to .src
@ar30 -rquv stc32lib.src stc32lib.c @echo.
@echo Creating RELEASE library from archive ...
mk30 --k -o2 -ms stc32lib.src -l stc32lib.lib @echo.
|
㊣
版主 發表:261 回覆:2302 積分:1667 註冊:2005-01-04 發送簡訊給我 |
|
kin0525
一般會員 發表:3 回覆:3 積分:1 註冊:2005-03-09 發送簡訊給我 |
真是不好意思 因為我不知道怎麼關閉主題
不過我已經將此問題解決
我主要是用在TMS320VC33PGE上
我用同樣的方法 也可以用在C6X上面
我將編譯的方式 寫成中文 可以提供大家參考一下 ar30 -rquv vc33.src VC33.h(將自己寫好的VC33.h用ar30 -rquv的指令編輯成vc33.src)
ar30 -rquv vc33.src vc33lib.c(將自己寫好的vc33lib.c用ar30 -rquv的指令編輯成vc33.src)
ar30 是產生.src檔案的命令.
–r 把指定的檔案放在Library.
–q (quiet) 不產生狀況訊息.
–u 把指定的檔案放在Library. 這個命令必須與 -r 一起使用.
–v (verbose) 從舊的library所組成的檔案中產生一個新的library. mk30 --k -o2 -ms vc33.src -l vc33.lib(將已產生的vc33.src用mk30的指令編輯成vc33.lib)
mk30 產生library的命令.
--k 指示mk30去覆蓋原始檔案.
–o2 (or -o) level 2; level 1 總體最佳化
–ms 當最佳化時讓全部記憶體存取
–l 是可選擇library的名稱.若你不指定一個名稱給library,mk30將使用與來源檔案相同的名稱給library .
(把自己寫好的.c與.h檔案跟執行指令放在同一目錄下,在執行這兩行命令前,
請先將自己寫好的source code做備份,因為在編輯後不論是否有成功產生library,
都會把source code刪除)
|
㊣
版主 發表:261 回覆:2302 積分:1667 註冊:2005-01-04 發送簡訊給我 |
|
kin0525
一般會員 發表:3 回覆:3 積分:1 註冊:2005-03-09 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |