0
Hello, I needed a function to paint pixels on the console.
I came up with a solution here but when compiling gives me the following mistake:
C: Users user user Appdata Local Temp ccORhjHu. o:test.cpp:(.text+0xa1): Undefined Reference to `Setpixel@16'
collect2.exe: error: Ld returned 1 Exit status
I would like to be provided with a way to correct this mistake or another way to do the same thing.
Note: I use windows 7 32-bit, with mingw c++ installed
You included the libgdi32.a in the compilation (with
-lgdi32
)?– Gomiero
I include this flag but gives another error. Gives this error: Undefined Reference to 'Std::ios_base::Init::Init()'
– Simple coder
What is the complete command you are using to compile?
– Gomiero
gcc filename.cpp -lgdi32 and includes unistd. h library and replaces
cin.ignore();
forsleep(5);
because I was making a mistake– Simple coder
Isn’t the program in C++? If it is, the line should be
g++ filename......
. The gcc is for C programs, not C++– Gomiero
Thank you very much! It worked, just one thing, gcc should work because cpp is C Plus Plus (C++). I could turn that comment into an answer to mark it as correct?
– Simple coder