You'll need all of the headers that SQLITE for the compiler, if they're all in the INCLUDE path it may make things easier. Another option is to pre-screen the data so you don't need to link the UDF to the whole lot: that may reduce the need for the SQLITE bits.