C++ error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Project: Teachg
# Makefile created by Dev-C++ 5.6.2

CPP      = g++.exe
CC       = gcc.exe
WINDRES  = windres.exe
OBJ      = main.o
LINKOBJ  = main.o
LIBS     = -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/lib" -static-libstdc++ -static-libgcc -mwindows -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
INCS     = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include"
CXXINCS  = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include/c++"
BIN      = Teachg.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)
	$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)

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

the errors are 25 C:\Users\**********\Documents\Makefile.win recipe for target 'Teachg.exe' failed
C:\Users\**********\Documents\collect2.exe [Error] ld returned 1 exit status
C:\Users\**********\Documents\main.o main.cpp:(.text+0x0): first defined here
C:\Program Files (x86)\Dev-Cpp\MinGW32\lib\libbgi.a(winthread.o) winthread.cxx:(.text+0x640): multiple definition of `WndProc(HWND__*, unsigned int, unsigned int, long)@16'

can someone tell me what to do to fix these errors please? thank you! :D
Last edited on
This means that WndProc is already defined in libbgi that you are linking using "-lbgi"

I dont know what libbgi is so cant comment if you need to keep the version in bgi or the one you have defined in main.cpp, but you have to keep only one of these
Or just rename the one in main. That might be easier.
Topic archived. No new replies allowed.