Although, technically, you probably can, I wouldn't recommend it.
This would be termed "cross-compiling".
Generally, cross-platform packages are intended to be built in the native environment of the target.
That is, a cross-platform package that is designed to be built for either Windows or Linux is intended to be built with make/Gnu C for Linux or Visual C++ for Windows. It will come with both a make file and a Visual C++ project file.
You want to build a Linux package with Visual C++ (not sure if this is even possible) or a Windows package with make/Gnu C, you're on your own!
Cross-compiling under Gnu C is commonly done only for firmware - for example for the ARM processor. Gnu C won't do that out-of-the-box, though. You need to obtain or build a version of Gnu C that runs on your development platform but targets the execution platform. (Not all combinations are available in binaries.)
Now, Linux and Windows (typically) share the same hardware architecture. But not the same library and object formats. At minimum, you'd need an alternate linker and library builder.
I wouldn't try it. If you need to build a Windows app or library, use Visual C++. Or use a Windows Gnu C (not real common).