Unable to compile or run sqlite3 using Visual Studio 2015

0

I'm trying to compile the source of sqlite3.c and shell.c I downloaded from the SQLite website using Visual Studio 2015. I created DLL project sqlite3 and put the sqlite3.c source into it. Then I created project sqlite3shell and put shell.c source into it. I added include "stdafx.h" into both. When I compiled both projects the DLL did not produce a .lib file, so the compile of sqlite3shell got the error LNK1104 cannot open sqlite3.lib.

I manually created a .lib file using this solution. Then the sqlite3shell program compiled successfully. But when I went to run the program, I got the error The application was unable to start correctly (0xc000007b). Looking into this error is seems one reason it could be caused is by trying to access a 64-bit program from a 32-bit program. But everything was created using the x86 configuration.

Is there some way to have the DLL compile produce the correct .lib file? Or if that won't fix the problem, is there something I can do to prevent the 0xc000007b error?

c
visual-studio
visual-studio-2015
sqlite
asked on Stack Overflow May 3, 2017 by J. Toran • edited May 23, 2017 by Community

1 Answer

0

In case someone else should have this problem, I have found the solution. There were 2 lines that specified the define of SQLITE_API. I added the export to the define like this: # define SQLITE_API __declspec(dllexport). Apparently there were no exports, so that was why the .lib file was never created. With the change, the .lib and .exp files were created and then the program didn't get the 0c000007b error.

answered on Stack Overflow May 4, 2017 by J. Toran

User contributions licensed under CC BY-SA 3.0