0

I'm trying to use the 64-bit DLL for SQLite, with no success. I can use the 32-bit version successfully using the same configuration. Why is there a difference?

I have created an x64 project in Visual Studio 2008/VC++.

I've downloaded the x64 sqlite binaries from here.

I've taken the sqlite3.h from the amalgamation source code at the same site and added to my Header Files in the project.

In my VS project, I've added the sqlite directory to Linker->General->Additional Library Directories. I put sqlite3.lib in Linker->Input->Additional Dependencies.

I wrote some very basic sqlite code to ensure this all worked:

#include "stdafx.h"
#include "sqlite3.h"

int _tmain(int argc, _TCHAR* argv[])
{
    sqlite3 *dbfile;
    sqlite3_close(dbfile);
    return 0;
}

When I compile, the linker complains:

error LNK2001: unresolved external symbol sqlite3_close

I've also set the linker output to /verbose to see this:

Searching C:\sqlite-dll-win64-x64-3130000\sqlite3.lib:

What am I missing here? Something obvious? HELP!

p.s. As a sanity check, I've done all the above steps for a Win32 VS application with the x86 binaries, and I have no Linker errors in that case. And I see this:

1>    Searching C:\sqlite-dll-win32-x86-3130000\sqlite3.lib:
1>      Found _sqlite3_close
1>        Referenced in MyProject.obj
1>        Loaded sqlite3.lib(sqlite3.dll)
N.Bo
  • 56
  • 5
  • check the Linker settings in your Project settings (project->Settings->Linker settings). There is somewhere an Option to tell your VisualStudio to use that dll for linking the symols of the sql header. – R. Joiny Jun 29 '16 at 00:39
  • Possible duplicate of [How to add a .dll reference to a project in Visual Studio](http://stackoverflow.com/questions/12992286/how-to-add-a-dll-reference-to-a-project-in-visual-studio) – TemporalWolf Jun 29 '16 at 00:50
  • @R.Joiny I tried toggling 'Use Library Dependency Inputs' option, neither setting worked. Is there another setting? (Not a duplicate, I can use a 32-bit dll with no problem, just not 64-bit version.) – N.Bo Jun 29 '16 at 16:50
  • Have you put your *.dll into the `C:\Windows\SysWOW64` folder? I always put dlls into System32, but for 64bit you have to use the SysWOW folder... – R. Joiny Jun 30 '16 at 01:46
  • @R.Joiny No, I haven't tried that, but this is the *.lib derived from the .dll that I'm trying to link. I wouldn't think the .dll location would matter, since it can't link to the .lib on compile. I will give it a try anyway just to be sure. – N.Bo Jul 01 '16 at 16:24
  • @N.Bo If you use a *.lib and no dynamic library, the location of the *.dll doesn't matter at all, because this library is static and completely included in your objects after compiling. – R. Joiny Jul 04 '16 at 00:24

0 Answers0