11

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).

schoetbi
  • 12,009
  • 10
  • 54
  • 72
knocker_d
  • 506
  • 6
  • 16

1 Answers1

1

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.

rep_movsd
  • 6,675
  • 4
  • 30
  • 34