2

From the download sqlite.org/download, they provide Precompiled Binaries for Windows for both x86 and x64. So, what gets downloaded is a .def file and a .dll file. Using this two files you can create the .lib file. [Command: lib /def:yourfile.def /out:yourfile.lib]

On creating the .lib file and using it as a dependency, things are working fine for x86. But for x64, Visual Studio is showing the error:

LNK4272: library machine type 'X86' conflicts with target machine type 'x64'

Is anyone else facing this?

Community
  • 1
  • 1
nik
  • 31
  • 7
  • 1
    Why a DLL? Just [compile it into your application](http://www.sqlite.org/howtocompile.html). – CL. Mar 06 '17 at 11:13
  • Thanks. Also found out where I was going wrong. While creating the .lib file, weshould be using the following command: lib /def:sqlite3.def /machine:X64 /out:sqlite3.lib I was skipping the /machine:X64 option before. – nik Mar 06 '17 at 11:29
  • Please write that as an answer. – CL. Mar 06 '17 at 11:32

1 Answers1

1

Found out where I was going wrong.

While creating the .lib file, we should be using the following command: lib /def:sqlite3.def /machine:X64 /out:sqlite3.lib

I was skipping the /machine:X64 option before. Better to see what are all the options provided by a command.

Example: lib /?

The output will be:

usage: LIB [options] [files]

  options:

  /DEF[:filename]
  /ERRORREPORT:{NONE|PROMPT|QUEUE|SEND}
  /EXPORT:symbol
  /EXTRACT:membername
  /INCLUDE:symbol
  /LIBPATH:dir
  /LIST[:filename]
  /LTCG
  /MACHINE:{ARM|ARM64|EBC|X64|X86}
  /NAME:filename
  /NODEFAULTLIB[:library]
  /NOLOGO
  /OUT:filename
  /REMOVE:membername
  /SUBSYSTEM:{BOOT_APPLICATION|CONSOLE|EFI_APPLICATION|
              EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|
              NATIVE|POSIX|WINDOWS|WINDOWSCE}[,#[.##]]
  /VERBOSE
  /WX[:NO]
nik
  • 31
  • 7