Assuming that we have a dll exporting void foo (void), an attempt to import and call it using import_alias may crash with access violation or cause other problems. This basic example similar to the one present at import_alias comment crashes:
#include <boost/dll/import.hpp>
int main()
{
::boost::dll::import_alias<void (void)>("TestDll.dll", "foo")();
}
Assuming that we have a dll exporting
void foo (void)
, an attempt to import and call it usingimport_alias
may crash with access violation or cause other problems. This basic example similar to the one present atimport_alias
comment crashes:import_alias
suppliesvoid * (void)
as type ofshared_library::get
which causes it to invoke
aggressive_ptr_cast<void (**)(void)>(get_void(symbol_name))
incorrectly casting symbol pointer.related SO question