wxWindows may be used to produce DLLs which run under Windows 3.1. Note that this is not the same thing as having wxWindows as a DLL, which is not currently possible. For Microsoft C++, use the makefile with the argument DLL=1 to produce a version of the wxWindows library which may be used in a DLL application. There is a bug in Microsoft C++ which makes the compiler complain about returned floats, which goes away when the /Os option is used, which is why that flag is set in the makefile.
For making wxWindows as a Sun dynamic library, there are comments in the UNIX makefile for the appropriate flags for AT&T C++. Sorry, I haven't investigated the flags needed for other compilers.