Jun 2, 2014 at 9:54pm UTC
errors
C:\Users\Death Knight\OneDrive\Documents\main.o main.cpp:(.text+0x46): undefined reference to `initwindow'
C:\Users\Death Knight\OneDrive\Documents\collect2.exe [Error] ld returned 1 exit status
25 C:\Users\Death Knight\OneDrive\Documents\Makefile.win recipe for target 'tt.exe' failed
code
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: tt
# Makefile created by Dev-C++ 5.6.3
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = main.o
LINKOBJ = main.o
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib32" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static -libgcc -m32
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.8.1/include"
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.8.1/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++"
BIN = tt.exe
CXXFLAGS = $(CXXINCS) -m32
CFLAGS = $(INCS) -m32
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)
main.cpp code 1 2 3 4 5 6 7 8 9
#include <graphics.h>
#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
initwindow(300,300);
}
can someone help me resolve these errors? the project name is tt. The process is not running in the background... If someone could help me, that would be great :D
Last edited on Jun 2, 2014 at 9:54pm UTC
Jun 3, 2014 at 7:03am UTC
does it work if you remove windows.h? my windows programming knowledge is pretty spotty, but based on research, you called it right. that linker error only appears when you call a function incorrectly (for example incorrect number of args but you did that), but windows.h might be screwing with it, or you need to link to a .a or .so library
Jun 3, 2014 at 1:27pm UTC
That isn't a WinAPI function... What are you trying to do OP?