| Verify If OpenSSL Is Installed | ls /usr/x86_64-w64-mingw32/include/openssl/ | Check if OpenSSL headers exist for MinGW. If missing, proceed to installation. |
| Install OpenSSL Development Headers for Linux (Temporary Fix) | sudo apt install libssl-dev | Installs OpenSSL for Linux but not for MinGW. Needed only for Linux compilation. |
| Download OpenSSL Source | wget https://www.openssl.org/source/openssl-3.5.0.tar.gz && tar -xvzf openssl-3.5.0.tar.gz && cd openssl-3.5.0 | Download and extract OpenSSL source for manual installation. Use the latest stable release from https://www.openssl.org/source/ (3.0.x is EOL and had numerous CVEs). |
| Build OpenSSL for MinGW | ./Configure mingw64 --cross-compile-prefix=x86_64-w64-mingw32- && make && sudo make install | Compile OpenSSL specifically for MinGW. Installs to /usr/local/ssl. |
| Use the Correct Include Paths | x86_64-w64-mingw32-g++ -o loader.exe mal.cpp -I/usr/local/ssl/include -L/usr/local/ssl/lib -lssl -lcrypto | Ensure the correct OpenSSL headers are used in the MinGW compilation. |
| Final Check | ls /usr/local/ssl/include/openssl/ | Verify OpenSSL headers are installed. If present, compilation should work! |