补代码:
# Project: test1
# Makefile created by Dev-C++ 5.11
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = main.o D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/test/acllib.o
LINKOBJ = main.o D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/test/acllib.o
LIBS = -L"D:/Dev-Cpp/MinGW64/lib" -L"D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc -mwindows D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib/libwinmm.a D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib/libmingw32.a D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32/libkernel32.a D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32/libgdi32.a D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32/libuser32.a D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32/libole32.a D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32/liboleaut32.a D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32/libuuid.a
INCS = -I"D:/Dev-Cpp/MinGW64/include" -I"D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
CXXINCS = -I"D:/Dev-Cpp/MinGW64/include" -I"D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"D:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
BIN = test1.exe
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)
RM = rm.exe -f
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
main.o: main.c
$(CC) -c main.c -o main.o $(CFLAGS)
D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/test/acllib.o: D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/test/acllib.c
$(CC) -c D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/test/acllib.c -o D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/test/acllib.o $(CFLAGS)
显示错误:
C:\Users\user\Documents\test\collect2.exe [Error] ld returned 1 exit status
指的是 $(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
写的代码是:
#include "acllib.h"
#include<stdio.h>
int Setup()
{
initConsole();
printf("输入宽度:");
int width;
scanf ("%d",&width);
initWindow("test",100,100,width,width);
beginPaint();
line(20,20,width-20,width-20);
endPaint();
return 0;
}
然后程序运行出现错误的是第一个代码,想问为什么会出现这个错误