knocker_d
knocker_d

Reputation: 576

compile win32 library from exprtk

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

Upvotes: 17

Views: 717

Answers (1)

rep_movsd
rep_movsd

Reputation: 6895

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.

Upvotes: 3

Related Questions