Creating an sqlite3.lib file / using sqlite3 in Vi

2020-07-05 18:52发布

问题:

I can't for the life of my get this code to compile. I have it running fine on all other computers, but I had to switch to a windows machine and I am attempting to add sqlite3 back to the included header files and it is nothing short of a nightmare.

I have downloading the proper files, installed it correctly, the header file is being found in Visual Studios, but I am getting a ton of unresolved externals. I found that I need to create the .lib file myself and then I should be all set. I went ahead and tried using the LIB.exe included within Visual Studios on the .def file ( I have the .def, .dll, .c, and .exe file), and I get the error that it is unable to open sqlite3.lib. Am I using the wrong command or something? I have spent hours looking it up and I believe I am doing it correctly.

My command is LIB /DEF:sqlite3.def

Should I be using something else? I do not have any object files, just the def file.

回答1:

The suggested way of using the SQLite library is to embed it directly in your application, i.e., download the amalgamation source code, and just add the sqlite3.c and .h files to your project in the sample place where you have the other source files.