Recipe for target’Project 1.exe’ failed Cause analysis and solution

Background: The end of the B tree implementation, multi – file programming.


The following error occurred on CodeBlock

ld returned 1 exit status this error has been encountered before, because the previously run program was not closed, it can be compiled after closing.
But I don’t have a running application window here, so that’s not the case.
Search engine search, tried a lot of methods, no results.


The compiler has too little information to debug. Guess it’s CodeBlock. Try dev instead.
The following error occurred on Dev

# Project: Project1
# Makefile created by Dev-C++ 5.11

CPP      = g++.exe -D__DEBUG__
CC       = gcc.exe -D__DEBUG__
WINDRES  = windres.exe
OBJ      = B_tree.o main.o
LINKOBJ  = B_tree.o main.o
LIBS     = -L"D:/Program Files (x86)/Dev-Cpp/MinGW32/lib" -L"D:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/lib" -static-libstdc++ -static-libgcc -g3
INCS     = -I"D:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"D:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"D:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include"
CXXINCS  = -I"D:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"D:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"D:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include" -I"D:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include/c++"
BIN      = Project1.exe
CXXFLAGS = $(CXXINCS) -g3
CFLAGS   = $(INCS) -g3
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)
	$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)

B_tree.o: B_tree.cpp
	$(CPP) -c B_tree.cpp -o B_tree.o $(CXXFLAGS)

main.o: main.cpp
	$(CPP) -c main.cpp -o main.o $(CXXFLAGS)

Line 25 is marked red and prompted by the compiler
25 C:\Users\ASUS\Desktop\ makefile.win recipe for target 'item 1. Exe' failed
>
>
>
2. Task manager ended collect2.exe (I didn’t see it in task manager)
3. Other Settings on attributes (some tried but failed, some didn’t dare to try)
Then saw an article: IT in the house of a blog post, link is as follows: http://www.it1352.com/369267.html

similar, is also 25 line error, but he’s a good look at the compiler information (see the full) than me, he said that the compiler meaning is as follows:
he repeats the main function of definition,
the first time and then the main definition in which files which line
and then two rows behind the information mentioned above.
His solution is to delete the duplicate main
what???

Read More: