diff --git a/examples/COUPLE/plugin/liblammpsplugin.c b/examples/COUPLE/plugin/liblammpsplugin.c index 1350a16513..09912448d7 100644 --- a/examples/COUPLE/plugin/liblammpsplugin.c +++ b/examples/COUPLE/plugin/liblammpsplugin.c @@ -60,9 +60,9 @@ liblammpsplugin_t *liblammpsplugin_load(const char *lib) lmp->handle = handle; #ifdef _WIN32 -#define ADDSYM(symbol) lmp->symbol = (void *) GetProcAddress((HINSTANCE) handle, "lammps_" #symbol) +#define ADDSYM(symbol) *(void **) (&lmp->symbol) = (void *) GetProcAddress((HINSTANCE) handle, "lammps_" #symbol) #else -#define ADDSYM(symbol) lmp->symbol = dlsym(handle,"lammps_" #symbol) +#define ADDSYM(symbol) *(void **) (&lmp->symbol) = dlsym(handle,"lammps_" #symbol) #endif #if defined(LAMMPS_LIB_MPI)