Search code examples
ubuntustandard-libraryipopt

"cannot find stddef.h" error when compiling Ipopt example in ubuntu 16.04


I installed Ipopt debian package in ubuntu 16.04. When I tried to do an example problem given in the Ipopt documentation, I'm getting the following error

/usr/include/coin/IpSmartPtr.hpp:18: error: #error "don't have header file for stddef"

I hope some it is some dependency issue. How do I solve this?


Solution

  • I can work around this by either doing

    #define HAVE_CSTDDEF
    #include <IpTNLP.hpp>
    #undef HAVE_CSTDDEF
    

    or

    #define HAVE_STDDEF_H
    #include <IpTNLP.hpp>
    #undef HAVE_STDDEF_H
    

    Try this link.