在尝试make
C程序时,出现以下错误,这是什么意思,为什么第四行包含问号?
C:\xxxxx\yyyyy\zzzz>make
cc gcc -I. -c -o facetrain.o facetrain.c
process_begin: CreateProcess(NULL, cc gcc -I. -c -o facetrain.o facetrain.c, ...) failed.
make (e=2): ?e? e??a? d??at? ? e??es? t?? ?a????s╡???? a??e??? ap? t? s?st?╡a.
make: *** [<builtin>: facetrain.o] Error 2
Makefile
您可能会注意到,如果您查看源代码(我在下面提供了链接),我已经更改了cflag中的编译器以匹配mingw编译器。
CFLAGS=gcc -I.
LFLAGS=
facetrain: facetrain.o imagenet.o backprop_initr.o pgmimage.o
$(CC) ${LFLAGS} facetrain.o imagenet.o backprop_initr.o pgmimage.o \
-o facetrain -lm
hidtopgm: hidtopgm.o pgmimage.o backprop_initr.o
$(CC) ${LFLAGS} hidtopgm.o pgmimage.o backprop_initr.o \
-o hidtopgm -lm
outtopgm: outtopgm.o pgmimage.o backprop_initr.o
$(CC) ${LFLAGS} outtopgm.o pgmimage.o backprop_initr.o \
-o outtopgm -lm
facetrain_init0: facetrain.o imagenet.o backprop_init0.o pgmimage.o
$(CC) ${LFLAGS} facetrain.o imagenet.o backprop_init0.o pgmimage.o \
-o facetrain_init0 -lm
backprop_initr.o: backprop.c backprop.h
$(CC) ${CFLAGS} -c backprop.c
mv backprop.o backprop_initr.o
backprop_init0.o: backprop.c backprop.h
$(CC) ${CFLAGS} -c -DINITZERO backprop.c
mv backprop.o backprop_init0.o
其余的源代码:
http://www.cs.cmu.edu/afs/cs.cmu.edu/project/theo-8/faceimages/code/
环境: Windows 10 Uning MinGW,gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --with-gmp=/mingw --with-mpfr --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
答案 0 :(得分:1)
我无法解释您的编码问题,但您的错误很容易解释:
CFLAGS=gcc -I.
您已经在标志中添加了“ gcc”,然后像这样调用编译器:
$(CC) ${CFLAGS} ...
所以从命令“ make prints”中可以看到:
cc gcc -I. ...
作为编译行。
您应单独设置编译器:
CC = gcc
CFLAGS = -I.