I'm trying to compile my C++ app for Windows, using my Linux machine. My issue occurs when I'm executing the compiled exe.
Here's a quick example of my issue.
helloworld.cpp:
#include <iostream>
int main()
{
std::cout << "Hello, World!" << std::endl;
return 0;
}
This code compiles and runs perfectly using g++ on Linux. But when I try compiling it with mingw: i686-w64-mingw32-g++ helloworld.cpp -o helloworld.exe
it compiles, but when I try running Windows tells me libgcc_s_dw2-1.ddl is missing.
I resolved this problem using the -static-libgcc -static-libstdc++
compiler flags to static link all the needed libraries, but Windows still gives me an error: libwinpthread-1.dll is missing.
I haven't found anything useful yet, to answer my question, so does anyone know how do I correctly compile this code to Win32 using MinGW-w64? Thanks!