10

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.

4
  • 1
    You can't build anything with just a def file. Do you have any source files? Where did you get the distribution from? Is it the amalgamation zip file?
    – cup
    May 18, 2014 at 6:03
  • 8
    It seems you have to build your own lib file. Perform the one-off command: LIB /DEF:sqlite3.def /OUT:sqlite3.lib
    – quamrana
    May 5, 2015 at 15:36
  • How do you get the .def file?
    – Mitch
    Jul 6, 2015 at 23:17
  • The gist describes how to generate a lib file. gist.github.com/zeljic/d8b542788b225b1bcb5fce169ee28c55
    – Ajit
    Aug 11, 2021 at 13:55

1 Answer 1

6

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.

1
  • Except the the .obj file is about 4MB in size, and takes 4 minutes to compile (not a pretty picture with PCH) Dec 31, 2016 at 8:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.