Open helske opened 2 weeks ago
The nlopt.h header has it defined as
NLOPT_EXTERN(const char *) nlopt_get_errmsg(nlopt_opt opt);
and the problem may be that we do not hold one (long enough?) to the nlopt_opt
instance describing it. So it would likely require some minor rejigging of things.
A cheapish way may be put a fixed-length char buffer somewher (easy and ugly: as a global var), say char buf[256]
, and in the case of error have that function called to fill it. You can then easily add an R accessor to buf
to return its content as a character variable to R.
I'm using nloptrAPI in my pacakge and trying to figure out why my optimization fails with generic error code -1. I noticed that there is a function
nlopt_get_errmsg
in NLopt but when trying to use it in my R package I get an errorundefined reference to
nlopt_get_errmsg'` during the compilation. Is this function missing from the API, and if so, could it be added?