首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

MinGW无法生成.a?解决思路

2012-03-17 
MinGW无法生成.a?尝试如下:1hellos.h文件中:voidprintS(char*str)2hellos.c文件中:#includehellos.h vo

MinGW无法生成.a?
尝试如下:
1   hellos.h文件中:
void   printS(char*   str);

2   hellos.c文件中:

#include   "hellos.h "

void   printS(char*   str)
{
    printf( "print   in   static   way:   %s ",   str);
}

3   在MinGW中输入
gcc   -c   -o   hellos.o   hellos.c
ar   cqs   libhellos.a   hellos.o
想生成一个libhellos.a库,却出现了如下的错误提示:

new@MICROSOF-ACBC06   /c/msys/local
$   cd   /f/asdf

new@MICROSOF-ACBC06   /f/asdf
$   gcc   -c   -o   hellos.o   hellos.c
In   file   included   from   hellos.c:1:
hellos.h:6:7:   warning:   no   newline   at   end   of   file
hellos.c:6:2:   warning:   no   newline   at   end   of   file

new@MICROSOF-ACBC06   /f/asdf
$   ar   cps   libhellos.a   hellos.o
libhellos.a:   No   such   file   or   directory
C:\msys\mingw\bin\ar.exe:
new@MICROSOF-ACBC06   /f/asdf
$  
怎么会这样?

[解决办法]
-s说错了..
[解决办法]
gcc -c HelloWorld.c -o HelloWorld.o


ar cqs libHelloWorld.a HelloWorld.o

热点排行