由于需要给MTK平台提供一些API,用ADS编译后发现生成的库文件是.a后缀的,因为习惯使用.lib形式的后缀,又担心直接修改后缀名称会出问题,所以想研究一下怎么把.a修改成.lib文件
命令行模式下输入armar查询参数,发现了几个比较需要的参数:
-x Extract members in <file_list> placing in files of the same name.
-t Print table of contents of archive.
-create Force creation of a new archive.
于是,输入armar -t csk2.a查看了库文件的组成文件列表,然后输入armar -x csk2.a解压出全部.o文件,最后armar -create csk2.lib *.o,成功生成csk2.lib。
后来直接把*.o文件改为*.LIB文件,发现也能正常使用.................
-r Insert files in <file_list>, replace existing members of the same name.
-d Delete the members in <file_list>.
-x Extract members in <file_list> placing in files of the same name.
-m Move files in <file_list>.
-p Print files to stdout.
-a pos Insert/move files after file named <pos>.
-b pos Insert/move files before file named <pos>.
-u Update older files only, used with -r.
-d Delete the members in <file_list>.
-x Extract members in <file_list> placing in files of the same name.
-m Move files in <file_list>.
-p Print files to stdout.
-a pos Insert/move files after file named <pos>.
-b pos Insert/move files before file named <pos>.
-u Update older files only, used with -r.
-n Do not add a symbol table to an object archive.
-s Force regeneration of archive symbol table.
-t Print table of contents of archive.
-zs Show the symbol table.
-zt Summarize the archive contents (sizes + entries).
-c Suppress warning when a new archive is created.
-C Do not overwrite existing files when extracting.
-T Truncate file names to system maximum length.
-v Give verbose output.
-create Force creation of a new archive.
-via file Take additional arguments from via file.
-sizes List the size of each member and the library total.
-entries List sections containing ENTRY points.
-vsn Print the current Armar Version.
-help Print this message.
-s Force regeneration of archive symbol table.
-t Print table of contents of archive.
-zs Show the symbol table.
-zt Summarize the archive contents (sizes + entries).
-c Suppress warning when a new archive is created.
-C Do not overwrite existing files when extracting.
-T Truncate file names to system maximum length.
-v Give verbose output.
-create Force creation of a new archive.
-via file Take additional arguments from via file.
-sizes List the size of each member and the library total.
-entries List sections containing ENTRY points.
-vsn Print the current Armar Version.
-help Print this message.
Examples:-
armar -r mylib.a obj1 obj2 obj3...
armar -x mylib.a ?sort*
armar -d mylib.a hash.o
armar -tv ansilib.a
armar -x mylib.a ?sort*
armar -d mylib.a hash.o
armar -tv ansilib.a