I'm coding a program that glitches the screen. Here is the code:
#include <Windows.h>
#include <iostream>
#include <windows.h>
#include <chrono>
#include <bits/stdc++.h>
#include <time.h>
void GlitchScreen() {
int x, y, randx, randy;
x = GetSystemMetrics(SM_CXSCREEN);
y = GetSystemMetrics(SM_CYSCREEN);
for (int k=0; k<200; k++) {
randx = rand() % x + 0;
randy = rand() % y + 0;
BitBlt(GetDC(NULL),rand() % x + 0,rand() % y + 0,randx+200,randy+200,GetDC(NULL),randx,randy,NOTSRCCOPY);
}
}
int main() {
GlitchScreen();
}
I've not used #include "stdafx.h" beacuse I am not coding on Visual Studio and it doesn't work.
So, I get the error:
C:\Users\User\AppData\Local\Temp\ccyF5IDA.o:main.cpp:(.text+0x23a): undefined reference to `BitBlt@36'
collect2.exe: error: ld returned 1 exit status
I am compiling with MinGW and running in Windows 10.