Implement a warning message when building an dynamic library .so, .dll o...

...r a .dylib, which are currently not supported. Closes #2562.