SQLite Visual Studio Linker Errors
I have 2 C++ projects, one for Windows XP/Vista/7 (WinXP) and the other is for Windows Mobile 6 (WinMo). Both projects use the same source code.
I am trying to link against sqlite3.lib. I have generated this file using the lib tool that comes with VS and the sqlite.def file. I added this file to the Resource folder of both projects using Add -> Existing Item.... I also add开发者_StackOverflowed it in Additional Dependencies (Configuration Properties > Linker > Input). I also placed the sqlite3.dll file in the working and executable directories.
I wrote some code and the class that uses sqlite3 has #include "sqlite3.h".
Now, in the WinXP project, I am able to compile, link and perform database ops using the sqlite3 API. In the WinMo project, I can compile, but get linker errors for all the functions from the sqlite3 library I need:
1>Linking...
1>SQLiteDatabase.obj : error LNK2019: unresolved external symbol sqlite3_shutdown referenced in function "public: virtual __cdecl...
....
What am I doing wrong?
You need the .lib file, not the .obj file.
You are using the .obj file, you got that file from
Visual Studio 2010\Projects\projectname\projectname\Release
You need to get the .lib file with the same name from
Visual Studio 2010\Projects\projectname\Release
Does that make sense? Go back two folders, then go into the Release folder. Inside that release folder there will be the .lib file.
Ensure that you have the latest version of sqlite, and sqlite3_shutdown
is supported on both platforms.
I found this.
精彩评论