Painting pixels in c ++

0

Hello, I needed a function to paint pixels on the console. I've got a solution here but when compiling gives me the following error:

  

C: \ Users \ 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 provide me with a way to correct this error or another way of doing the same thing.

Note: I use windows 7 32-bit with mingw c ++ installed

    
asked by anonymous 05.05.2018 / 13:59

1 answer

1

According to the comments, the error was corrected after adding the GDI32 lib ( libgdi32.a ), where the SetPixel function is located.

The error:

undefined reference to 'std::ios_base::Init::Init()' 

occurred because of the use of the compiler gcc (used to compile programs in C ).

The correct compiler for the C ++ language in the Mingw32 package is: g++ .

    
04.06.2018 / 22:08