【发布时间】:2018-10-16 03:28:04
【问题描述】:
我在尝试使用 C++Builder 5 代码编译 sqlite 数据库时遇到问题。
我下载了 sqlite-amalgamation,并将所有文件添加到项目中:
shell.c
sqlite3.c
sqlite3.h
sqlite3ext.h
然后我将sqlite3.h 包含在将使用数据库的 MainForm 中。
首先我认为是我的代码有问题,但是在使用带有 DBGrid 的简单表单对其进行测试以显示数据库中的数据后,我得到了以下错误:
[C++ Warning] shell.c(205): W8065 Call to function '_setmode' with no prototype
[C++ Warning] shell.c(209): W8065 Call to function '_setmode' with no prototype
[C++ Error] shell.c(1420): E2257 , expected
[C++ Error] shell.c(1432): E2141 Declaration syntax error
[C++ Error] shell.c(1432): E2139 Declaration missing ;
[C++ Warning] shell.c(1432): W8004 'RC' is assigned a value that is never used
[C++ Error] shell.c(1432): E2190 Unexpected }
[C++ Error] shell.c(1460): E2040 Declaration terminated incorrectly
[C++ Error] shell.c(1460): E2141 Declaration syntax error
[C++ Error] shell.c(1460): E2141 Declaration syntax error
[C++ Error] shell.c(1729): E2190 Unexpected }
[C++ Error] shell.c(1729): E2190 Unexpected }
[C++ Warning] shell.c(2382): W8053 '_chmod(const signed char *,int,...)' is obsolete
[C++ Warning] shell.c(2504): W8065 Call to function 'S_ISLNK' with no prototype
[C++ Warning] shell.c(2529): W8065 Call to function 'S_ISLNK' with no prototype
[C++ Error] shell.c(2558): E2139 Declaration missing ;
[C++ Error] shell.c(2638): E2451 Undefined symbol 'pDir'
[C++ Error] shell.c(2638): E2451 Undefined symbol 'pDir'
[C++ Warning] shell.c(2638): W8065 Call to function 'closedir' with no prototype
[C++ Error] shell.c(2701): E2451 Undefined symbol 'pDir'
[C++ Warning] shell.c(2701): W8065 Call to function 'opendir' with no prototype
[C++ Error] shell.c(2702): E2451 Undefined symbol 'pDir'
[C++ Error] shell.c(2710): E2451 Undefined symbol 'pDir'
[C++ Warning] shell.c(2710): W8065 Call to function 'readdir' with no prototype
[C++ Warning] shell.c(2710): W8069 Nonportable pointer conversion
[C++ Error] shell.c(2712): E2451 Undefined symbol 'd_name'
[C++ Error] shell.c(2713): E2451 Undefined symbol 'd_name'
[C++ Error] shell.c(2713): E2451 Undefined symbol 'd_name'
[C++ Error] shell.c(2714): E2451 Undefined symbol 'd_name'
[C++ Error] shell.c(2717): E2451 Undefined symbol 'd_name'
[C++ Error] shell.c(2725): E2451 Undefined symbol 'pDir'
[C++ Warning] shell.c(2725): W8065 Call to function 'closedir' with no prototype
[C++ Error] shell.c(2727): E2451 Undefined symbol 'pDir'
[C++ Warning] shell.c(8794): W8072 Suspicious pointer arithmetic
[C++ Warning] shell.c(15699): W8065 Call to function '_isatty' with no prototype
[C++ Warning] shell.c(15700): W8065 Call to function '_isatty' with no prototype
有什么问题?
我按照 Internet 上关于如何添加 sqlite 的教程进行操作,但它们不起作用。
如果无法在 C++Builder 5 中使用 sqlite,是否有其他嵌入式数据库与之兼容?
我听说我可以使用 CSV 文件作为数据库,我可以这样做吗?如果有,怎么做?
【问题讨论】:
标签: c++ database sqlite c++builder-5