Date: Nov 24,2007
Revised: Jan 12,2008
I would like to thank George Rhoten and Roberto Padovani for taking the time to provide their Feedback!
George Rhoten an ICU Developer gave me great Feedback for making some corrections in my original article. As a result some project settings have been removed. He also suggests that the project setting for the ICU Library doesn't need to be changed,and one can simply tell the sqlite project where to find the libs. If you plan to keep up with the varIoUs ICU changes,then follow his advice.
I did things the way I did,because most likely you will download the source for ICU and sqlite so that your own project can use the sqlite database (I have a personal project that is using sqlite source before ICU was added as a requirement). Chances are slim you will keep updating the source for sqlite3 or ICU and risk your own project from breaking or have changes in these project introduce a bug in your project. Also you will not have to find and copy over the DLLs in order to be able to run your project's exe since my setup places all the DLLs into the same bin folder. Forgetting to copy over updated DLLs can be a source of needless debugging when things don't work right. The location for the bin and lib folders can be easily changed by making the changes to the environment variables.
Roberto Padovani provided me with some Feedback for those using Visual C++ Express. If you plan to go this route he suggests you do these steps:
- download and install VC++ Express (free)
- download and install Microsoft Platform SDK (PSDK) (the Windows Server 2003 is ok for windows XP)
- setup the options in VC++ Express so that it knows in which directory the PSDK stored the .lib files
- follow your tutorial,plus adding the advapi32.lib in order to be able to build iuc*
(*) I do not use Visual Studio Express,so I am not the right person to ask for help on using this edition or getting setup. That's a topic outside the scope of this article.
The building of sqlite has gotten a bit more involved. You not only have to download the sqlite source code but also the ICU Unicode Library source code. There are many build steps outlined on the sqlite.org wiki,but I am not sure if they all have kept up to the changes that have been going on? As a result this guide was produced to tie any loose ends that I found seem to be missing from the varIoUs wiki pages. If you find errors,typos or omission please let me know so that I may keep this Guide up to date!
Step 1
If you haven't already done so you will need to download the latest sqlite source code from: http://sqlite.org. Go to the sqlite project website and click on the "Download" link. From there scroll down to Precompiled Binaries For Windows and download the package for the DLL binary with TCL binding (sqlitedll-3_5_4.zip at the time of writing). We will need to get the definition file sqlite3.def which is required to build the sqlite3 DLL.
I have no idea why the project team doesn't add this file to the source code download? If you plan to make a static library,you don't need to do this step.
Step 2
Next you will need to download the sqlite3 source code. Scroll down to the source code area and download the zipped file which contains the preprocessed C code. At the time of writing,the file is called sqlite-source-3_5_4.zip
Step 3
Before you can build the sqlite project you will also need to download the ICU Unicode Library. Go to the,"International Components for Unicode" project website at: http://icu-project.org/index.html
Click on the download link and download the latest "Official Release" source code in zipped format for the Windows platform. At the time of writting the latest file is icu4c-3_8_1-src.zip
Step 4
At this point you should have the following 3 files,the names will be slightly different for future release versions.
Now create a project directory,for the purpose of this article,I am going to create a folder called,"sqlite3" under,"G:/dev/src/". You can choose another location where the source code will be get extracted.
- extract the ICU zip file to,"G:/dev/src/"
- extract both sqlite3 zip files to "G:/dev/src/sqlite3"
- create folder "G:/dev/src/build"
At this point your project folder hierarchy should be similar to:
We have one final clean up to do,and that is to delete "sqlite3.dll" from the location,"G:/dev/src/sqlite3/"
Note let's take a look at the Environment variables section...
原文链接:/sqlite/203210.html