[英]Can't compile a C program in Windows 7 with MinGW make
I want to compile a C program from GitHub on Windows 7 and get an error that a file is not found.我想从 Windows 7 上的 GitHub 编译一个 C 程序,并得到一个找不到文件的错误。 I have installed MinGW Make and its dependancies.
我已经安装了 MinGW Make 及其依赖项。 I think maybe this program is only intended to run on Linux.
我想也许这个程序只打算在 Linux 上运行。
The Console output:控制台 output:
E:\work-c\iso2opl-clone\iso2opl>make
gcc -std=gnu99 -pedantic -usr\include -usr\local\inc
lude -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -c isofs.c -o isofs.o
process_begin: CreateProcess(NULL, gcc -std=gnu99 -pedantic -F:\programs\mingw\i
nclude -F:\programs\mingw\local\include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SO
URCE -c isofs.c -o isofs.o, ...) failed.
make (e=2): Le fichier spécifié est introuvable.
make: *** [isofs.o] Erreur 2
the makefile: makefile:
CC = gcc
CFLAGS = -std=gnu99 -pedantic -I/usr/include -I/usr/local/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
#CFLAGS += -DDEBUG
ifeq ($(_WIN32),1)
CFLAGS += -D_WIN32
endif
OBJS = isofs.o \
iso2opl.o
all: $(TARGET)
rm-elf:
-rm -f $(TARGET) $(OBJS)
$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $(TARGET) $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -r $(OBJS) $(TARGET)
I don't know maybe the paths are wrongs.我不知道也许路径是错误的。
Best Regards此致
Try to run the make
in the MSYS2 shell ( https://www.msys2.org/ ).尝试在 MSYS2 shell ( https://www.msys2.org/ ) 中运行
make
。 I was able to build the sources from https://github.com/arcadenea/iso2opl without issue.我能够毫无问题地从https://github.com/arcadenea/iso2opl构建源代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.