On Sat, 28 Feb 2015 11:22:12 +0000 Bart Smissaert <bart.smissaert at gmail.com> wrote:
> It doesn't compile and gives linking errors: > > Error 1 error LNK2001: unresolved external symbol > _sqlite3_db_filename > C:\Users\Bart\SQLiteForExcel\Source\SQLite3_StdCall > \SQLite3_StdCall.obj SQLite3_StdCall > Error 2 error LNK1120: 1 unresolved > externals C:\Users\Bart\SQLiteForExcel\Source\SQLite3_StdCall\Release > \SQLite3_StdCall.dll 1 1 SQLite3_StdCall What you mean is, it *does* compile, and then the linker emits an error. :-) > Strangely it doesn't point to a line in the block SQLITE3_STDCALL_API > but points to line 1. Not strange, or anyway not too strange. The linker doesn't know from source code. It only knows the object code references a symbol for which it found no definition. The symbol you want, sqlite3_db_filename appears to be defined in sqlite3ext.h, line 475: #define sqlite3_db_filename sqlite3_api->db_filename If you include that file, the linker shouldn't attempt to resolve the symbol, because the preprocessor defines it away. HTH. --jkl