I would like to compile a win32 .dll or .lib from http://partow.net/programming/exprtk/index.html math expression library. What is the easiest way to do that ? I'm using MS VC++.
The code has only one .hpp that has all the code. Each time I compile my program it takes a long time because it compiles also exptrk.hpp file (over 1,000kB of code).
The problem of slow compilation you face is common when you have large header based libraries - but templates are not actually code, and cannot be compiled independently into a binary.
One solution is to use precompiled headers - to my knowledge, VC++ does this automatically. This saves a lot of time, and works great for library headers that never change. See https://yxbenj.wordpress.com/2013/06/29/a-quick-guide-to-using-precompiled-headers-visual-studio/
The other solution is to write a small wrapper lib around exprtk and expose plain C functions from a DLL. Whether you can do this depends on how exactly you are using exprtk in your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With