First off I assume you two know the difference between a DLL .LIB and a static 
.LIB -- they are different.
 
I used Microsoft Visual C++ Studio 2010 Express and 2008 Express and downloaded 
the windows sqlite3 DLL from the website
http://www.sqlite.org/sqlitedll-3_6_23_1.zip
 
 
#1 Open a Visual Studio Command Prompt
#2 lib /def:sqlite3.def /out:sqlite3.lib /machine:x86
#3 cl sqltest.c sqlite3.lib
#4 sqltest
 
Here's a simple test program I used
#include <stdio.h>
#include <stdlib.h>
#include "sqlite3.h"
int main()
{
 sqlite3 *db;
 char *errmsg=NULL;
 int rc;
 sqlite3_open("test.db",&db);
 rc=sqlite3_exec(db, "CREATE TABLE test (testme varchar)",NULL,NULL,&errmsg);
 if (rc != SQLITE_OK) {
  puts(errmsg);
  sqlite3_free(errmsg);
 }
 rc=sqlite3_exec(db, "INSERT INTO test values ('Testing 
varchar')",NULL,NULL,&errmsg);
 if (rc != SQLITE_OK) {
  puts(errmsg);
  sqlite3_free(errmsg);
 }
 sqlite3_close(db);
 return 0;
}
 
Compiles and links just fine.
 
First run produces no errors.
2nd run produces:
table test already exists
Just like it should.
 
If you can't do this you have more serious problems.
 
I then made a new console project from existing code under Visual C++ 2010 
Express and 2008 Express, added sqltest.c and sqlite3.lib and built and ran it 
with no problems (you need to copy the DLL into the project directory).
 
If need be I can email you guys a Visual Studio C++ 2008 complete zip file with 
everything in it but you should be able to reproduce this on your own.
 
If you want a static link just download the amalgamation and add sqlite3.c to 
your project or build your own library to link.
http://www.sqlite.org/sqlite-amalgamation-3_6_23_1.zip
 
Michael D. Black
Senior Scientist
Northrop Grumman Mission Systems
 

________________________________

From: sqlite-users-boun...@sqlite.org on behalf of Chris 'Xenon' Hanson
Sent: Wed 6/2/2010 8:11 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Problem with sqlite3



On 6/2/2010 9:56 AM, lukasz aaa wrote:
> Hello. Sorry for my English.
> I have a problem with the SQLite library reloaded correctly (use in
> project). I'm using VC++ 2010 and Dev.
> I add to project sqlite3.h, copy to folder with source sqlite3.dll and
> sqlite3.lib. I add sqlite3.lib to linker - i search information on
> forums, but can't compile program.
> I make file sqlite3.lib, with program lib.exe, after it not work do it
> with VC++ Create Library, don't work too.
> Error is " error C3861: 'sqlite_open': identifier not found".
> If you have time pleas help me.

  I too am trying to use the current sqlite 3. This is in an application that 
previously
was linked to a static sqlite 3. I can switch to the DLL version if needed. I 
built a .lib
from the .dll and .def file, and switched to the new .h and the .lib, but I had 
no success
linking, with the symbol not found errors.

  I would most like to find a static link version of the most current sqlite 
library, but
failing that, linking with the DLL version would be ok.

  I'm using MSVC++2008 Express.

--
Chris 'Xenon' Hanson, omo sanza lettere                  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to