In the FPC wiki there is a function to test library bitness (32/64 bits) on Windows. Maybe we should use that function to generate better error reporting when users try to load libraries of the wrong bitness?
https://wiki.freepascal.org/Multiplatform_Programming_Guide#Detecting_bitness_of_external_library_before_loading_it