转帖:为WinCE平台编译SQLite3.7动态库
2012-03-28 17:27
591 查看
昨天为WinCE平台编译了一份SQLite3.7动态库。
1. 在SQLite网站下载最新代码,推荐使用amalgamation 版本。
2. VS2005建立智能设备Win32DLL工程
3. 导入代码(除了shell.c)
4. 选中项目(而不是文件),项目->属性->C/C++->预编译头-> 创建/使用预编译头: 选择不使用预编译头。
5. 选中项目(而不是文件),项目->属性->链接器->输入-> 模块定义文件: 输入“sqlite3.def”。
6. 增加一个预定义宏 SQLITE_ENABLE_COLUMN_METADATA,否则链接出现以下错误。
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_database_name
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_database_name16
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_origin_name
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_origin_name16
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_table_name
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_table_name16
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_table_column_metadata
7. 注释掉以下部分:
[cpp]
view plaincopyprint?
//////////////////////////////////////////////////////////////////////////
//
// We must comment here, because WinCE doesn't have localtime_r and
// localtime_s. ---Brian Liu, 2010-07-22
//
//////////////////////////////////////////////////////////////////////////
//#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE_LOCALTIME_S) && /
// defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE)
//#define HAVE_LOCALTIME_S 1
//#endif
//////////////////////////////////////////////////////////////////////////
//
// We must comment here, because WinCE doesn't have localtime_r and
// localtime_s. ---Brian Liu, 2010-07-22
//
//////////////////////////////////////////////////////////////////////////
//#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE_LOCALTIME_S) && /
// defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE)
//#define HAVE_LOCALTIME_S 1
//#endif
8. 增加函数定义struct tm *__cdecl localtime(const time_t *t); 在函数体static sqlite3_int64 localtimeOffset(DateTime *p)之前。
9. 编译。
原文地址:
点击打开链接
1. 在SQLite网站下载最新代码,推荐使用amalgamation 版本。
2. VS2005建立智能设备Win32DLL工程
3. 导入代码(除了shell.c)
4. 选中项目(而不是文件),项目->属性->C/C++->预编译头-> 创建/使用预编译头: 选择不使用预编译头。
5. 选中项目(而不是文件),项目->属性->链接器->输入-> 模块定义文件: 输入“sqlite3.def”。
6. 增加一个预定义宏 SQLITE_ENABLE_COLUMN_METADATA,否则链接出现以下错误。
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_database_name
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_database_name16
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_origin_name
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_origin_name16
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_table_name
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_column_table_name16
sqlite3.def : error LNK2001: 无法解析的外部符号 sqlite3_table_column_metadata
7. 注释掉以下部分:
[cpp]
view plaincopyprint?
//////////////////////////////////////////////////////////////////////////
//
// We must comment here, because WinCE doesn't have localtime_r and
// localtime_s. ---Brian Liu, 2010-07-22
//
//////////////////////////////////////////////////////////////////////////
//#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE_LOCALTIME_S) && /
// defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE)
//#define HAVE_LOCALTIME_S 1
//#endif
//////////////////////////////////////////////////////////////////////////
//
// We must comment here, because WinCE doesn't have localtime_r and
// localtime_s. ---Brian Liu, 2010-07-22
//
//////////////////////////////////////////////////////////////////////////
//#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE_LOCALTIME_S) && /
// defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE)
//#define HAVE_LOCALTIME_S 1
//#endif
8. 增加函数定义struct tm *__cdecl localtime(const time_t *t); 在函数体static sqlite3_int64 localtimeOffset(DateTime *p)之前。
9. 编译。
原文地址:
点击打开链接
相关文章推荐
- 为WinCE平台编译SQLite3.7动态库
- SQLite3源码在Windows及WinCE平台下的编译方法
- SQLite3源码在Windows及WinCE平台下的编译方法
- SQLite3源码在Windows及WinCE平台下的编译方法
- VS2005下编译wince平台下的sqlite3源码出错启示
- 【转】SQLite3源码在Windows及WinCE平台下的编译方法
- SQLite3源码在Windows及WinCE平台下的编译方法
- SQLite3源码在Windows及WinCE平台下的编译方法
- VC2005编译SQLite,生成WINCE上使用的DLL和Lib
- 工作积累之WinCE平台的程序编译到Win32平台下运行
- VC2005编译SQLite,生成WINCE上使用的DLL和Lib
- 在arm-linux平台上的编译应用SQLite-3_5_8
- sqlite3在windows平台下编译
- 使用ubuntu14和ndk 编译ffmpeg在android平台的so动态库
- VC2005编译SQLite,生成WINCE上使用的DLL和Lib
- 在WinCE下编译sqlite3生成动态链接库
- 在mipsel-linux平台上的编译应用SQLite-3.5.9
- sqlite3在winCE下C编译的方法
- VC2005编译SQLite,生成WINCE上使用的DLL和Lib
- 在arm-linux平台上的编译应用SQLite-3.5.9