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
$
怎么会这样?