I'm working on an application written in C that's supposed to run on at least Linux and Windows. I usually work on Linux, so I'd like to be able to cross-compile my application for Windows.My current setup:Debian GNU/Linux amd64No complex build system, just a simple MakefileUsing GCC for Linux, MinGW for WindowsMy application depends on a number of libraries. Luckily, my distribution offers development headers, so compiling for Linux works pretty much out of the box using pkg-config to determine CFLAGS and LDFLAGS.It doesn't work that well for Windows. My distribution provides a compiler toolchain for x86_64-w64-mingw32, which is able to find the development headers, but for some libraries I need different versions for Windows. Unfortunately, these versions are not provided by my distribution so I have to install them on my own.So: Where do I install the development headers for Windows? How do I make pkg-config find it? Is there a way to just compile for Windows using a single command, just like I can compile for Linux by calling make?In my case, one of the libraries in question is SDL2. Trying to compile with the headers shipped by my distribution produces a fatal error: iconv.h: No such file or directory. Googling for this error also tells us to use the Windows version. Other libraries seem to work during the compiling stage, but obviously it can't find them during the linking stage.
How to properly set up a cross-compiling environment for Windows?
linux;windows;cross compilation;development