SQLite Windows
: 3121

ü Լ/
ġ : SQLite Windows


Contents

1 SQLite Windows
2 غ
2.1 Ϸ ȯ
3 ٿε
3.1
4 ̺귯
5 ׽Ʈ α׷ ۼ
6 ׽Ʈ
7
8 ũ



1 SQLite Windows


ۼ: mwyun()

SQLite ̴.

ڼ ũ Ʈ Ѵ.

2 غ


2.1 Ϸ ȯ

  1. VC++
  2. MinGW
  3. Cygwin

VC++θ ׽ƮѴ

3 ٿε

̺귯 ų ׽Ʈ α׷ ҷ ҽ ʿϴ.

sqlite α׷ α׷ν ϳε sqlite database ̿ ִ.

ٸ ̺귯 ʿ ʴ´.

C ̺ ؿ SQLite 丮  sqlite.zip, sqlitedll.zip, sqlite_source.zip ٿް Ǭ.

׷ 丮 ȴ.


3.1

  1. C:\SQLite\sqlite : α׷
  2. C:\SQLite\sqlitedll : SQLite dll, def
  3. C:\SQLite\sqlite_source : ҽ

4 ̺귯

  1. VC++ IDE Ѵ.
  2. Ʈ
    1. File > New ޴ ϰ Projects ǿ "Win32 Dynamic-Link Library" Ѵ.
    2. Project name : sqlite
    3. Location : C:\msdn\SQLite\sqlite_source\sqlite <- Ʈ ̸ 丮 .
    4. OK ư ŬѴ.
    5. "An empty DLL project" ⺻ õǾִ.
    6. Finish ư ŬϿ ִ DLL Ʈ .
  3. ҽ
    1. ִ DLL Ʈ̹Ƿ Ͽ ʿ ϵ Ʈ Ѵ.
    2. Workspace 쿡 Source Files ϰ "Add Files to Folder" Ѵ.
    3. â ߸ C:\SQLite\sqlite_source ̵Ͽ .c ϰ OK ư ŬѴ.
    4. ׷ ڵ C:\SQLite\sqlite_source c ҽ ϵȴ.
    5. Workspace 쿡 Header Files ϰ "Add Files to Folder" Ѵ.
    6. â ߸ C:\SQLite\sqlite_source ̵Ͽ .h ϰ OK ư ŬѴ.
    7. ׷ ڵ C:\SQLite\sqlite_source ϵȴ.
    8. C:\SQLite\sqlitedll\sqlite.def Ѵ.
  4. Ʈ
    1. Project > Settings ϰ C/C++ Ѵ.
    2. Preprocessor definitions NO_TCL(ũ ) ߰Ѵ. (",NO_TCL" Է)
      NO_TCL ũθ ߰ tcl εϴ ڵ(tclsqlite.c) Ͻ ߻Ѵ.

      C:\SQLite\sqlite_source\tclsqlite.c(19) : fatal error C1083: Cannot open include file: 'tcl.h': No such file or directory

      tcl ̿ ̹Ƿ tclsqlite.c ʱ NO_TCL ũθ ϸ ȴ.

    3. OK ư ŬѴ.

    1. Build > "build sqlite.dll" Ͽ ̺귯 Ͽ dll .

5 ׽Ʈ α׷ ۼ

Ʈ α׷ C ҽڵ带 ̿Ѵ.
  • [http]Qukck Start


  • VC++ IDE Ѵ.
  • Ʈ
    1. File > New ޴ ϰ Projects ǿ "Win32 Console Application" Ѵ.
    2. Project name : test
    3. Location : C:\SQLite\test <- Ʈ ̸ 丮 .
    4. OK ư ŬѴ.
    5. "An empty project" ⺻ õǾִ.
    6. Finish ư ŬϿ ִ Ʈ .
  • ҽ ۼ
    1. File > New ޴ ϰ Files ǿ "C++ Source File" ϰ File ׸ test.c ԷѴ.
    2. OK ư ŬѴ.
    3. Workspace 츦 test.c ߰ Ȯ ִ.
    4. "Quick Start" ִ C ҽ ڵ带 ؼ δ.
    5. Ѵ.
  • Ʈ

      1. Project > Settings ϰ C/C++ Ѵ.
      2. Preprocessor ϰ "Additional include directories" "C:\SQLite\sqlite_source" ߰Ѵ.
    1. ̺귯
      1. Project > Settings ϰ Link Ѵ.
      2. Input ϰ "Object/library modules" "sqlite.lib" ԷѴ.
      3. "Additional library path" "C:\SQLite\sqlite_source\sqlite\debug" ߰Ѵ.
        1. sqlite ̺귯 Ͽ 丮 ش.

    1. exit Լ ã´ٴ ߻ϸ "#include <stdlib.h>" ߰Ѵ.

  • 6 ׽Ʈ

    1. sqlite.dll test α׷ 丮 ִ ƴϸ ý 丮 ġؾѴ.
    2. sqlite.dll test α׷ 丮 Ѵ.
    3. â .
    4. test α׷ 丮 ̵Ѵ. -> C:\SQLite\test\Debug

    C:\SQLite\test\Debug>test
    Usage: test DATABASE SQL-STATEMENT
    
    C:\SQLite\test\Debug>test ex1 "create table tbl1(one varchar(10), two smallint)"
    
    C:\SQLite\test\Debug>test ex1 "insert into tbl1 values('hello!',10)"
    
    C:\SQLite\test\Debug>test ex1 "insert into tbl1 values('goodbye', 20)"
    
    C:\SQLite\test\Debug>test ex1 "select * from tbl1"
    one = hello!
    two = 10
    
    one = goodbye
    two = 20
    
    
    C:\SQLite\test\Debug>
    
    1. db Ȯغ.
    C:\msdn\SQLite\test\Debug>dir
     C µå¶óÀ̺êÀÇ º¼·ý: ·ÎÄà µð½ºÅ©
     º¼·ý ÀÏ·Ã ¹øÈ£: 2954-140B
    
     C:\SQLite\test\Debug µð·ºÅ͸®
    
    2004-02-15  05:01a      <DIR>          .
    2004-02-15  05:01a      <DIR>          ..
    2004-02-15  02:35p              41,984 vc60.idb
    2004-02-15  02:35p             203,764 test.pch
    2004-02-15  02:35p              53,248 vc60.pdb
    2004-02-15  02:35p               1,875 StdAfx.obj
    2004-02-15  02:35p               4,240 test.obj
    2004-02-15  02:35p             166,728 test.ilk
    2004-02-15  02:35p             155,699 test.exe
    2004-02-15  02:35p             320,512 test.pdb
    2004-02-15  02:33p             843,845 sqlite.dll
    2004-02-15  04:34p               3,072 ex1        <- db ÆÄÀÏÀÌ »ý¼ºµÇ¾ú´Ù.
                  10°³ ÆÄÀÏ       1,794,967 ¹ÙÀÌÆ®
                   2 µð·ºÅ͸®     743,096,320 ¹ÙÀÌÆ® ³²À½
    
    C:\SQLite\test\Debug>
    
    1. sqlite α׷ ex1 εϿ ׽Ʈغ ִ.

    7

    • 쿡 Ͽ ȮϿ.

    • sqlite ̿Ͽ 쿡 db α׷ dll ϸ ϸ ȴ.

    • ܼ gdbm ٴ sql ϹǷ ϸ Ͽ ִ.

    • pda Ͽ 淮 db ȰϿ ջ .


    8 ũ