Steve Frierdich wrote:
The sqlite3ErrStr function is giving me a linker error when compiled. All the other sqlite version 3_0_7 functions used compile correctly. Sqlite is compiled in to a static library, and that library is used in a Win32 application compiled in visual studio. The exact linker error that is shown when compiling the Win32 application using the library is:

unresolved external symbol "char const * __cdecl sqlite3ErrStr(int)

Can anyone give some information on maybe how to solve this? The sqliteint.h file is in included in the cpp file that calls the sqlite3ErrStr function

This is just a guess, but I think it's a pretty informed one. Unlike sqlite3.h, sqliteint.h (which, as I understand it, is really for internal use only and shouldn't be included in anything other than the SQLite files themselves) doesn't test for a C++ build and wrap its declarations up in an extern "C" {...}. Thus it's possible that MSVC is treating that function as a C++ function and "mangling" its name in the object file (since C++ functions can be overloaded, the compiler has to generate a different "mangled" name for each combination of parameters). But SQLite's API is strictly C, with unmangled names, so the linker wouldn't be able to resolve the mangled name.

Reply via email to