Menu

Header only?

Help
Don M
2020-04-07
2020-04-08
  • Don M

    Don M - 2020-04-07

    I am upgrading an old project from dlib version 18.18. At that time dlib was a header-only library, so I only needed to add dlib to my include path and I was all set. My project is built using visual studio (originally 2015, now 2019).

    Newer dlib versions require compiling dlib. I got things to work with version 19.19 by adding all/source.cpp to my visual studio project and making some modifications to get around errors (adding /bigobj to the compile options and dealing with precompiled headers). However my resulting DLL grows from 2 MB to 10 MB in size.

    The only thing I am using from dlib is the bobyqa optimization function, which appears to still be a header only implementation. Is there any way continue to use dlib as a header -only library?

     
    • Davis

      Davis - 2020-04-08

      Well, I shouldn't say "all". Dlib has never been all header only. But it
      should work like you expect.

       
    • Davis

      Davis - 2020-04-08

      Dlib is still just as header only as it always has been. However, I added
      that dlib/test_for_odr_violations.h file because I constantly get questions
      from people who were doing silly things with their builds, getting errors
      that have nothing to do with dlib, and asking me about it. If you blank
      out the contents of dlib/test_for_odr_violations.h it will all be header
      only again.

       
  • Don M

    Don M - 2020-04-08

    That works. Thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.