use cglobal rather than dlsym