'sqlite3_api'未在此作用域中声明 [英] 'sqlite3_api' was not declared in this scope
问题描述
我一直在C ++学习sqlite3编程第一次,这个错误混淆我和我的互联网搜索能力。
I've been learning sqlite3 programming in C++ for the first time and this error confounds me and my internet searching abilities.
这是我的代码,直到它在抛出错误之前。
Here is my code, as far as it gets before throwing an error.
#include <iostream>
#include <sqlite3ext.h>
using namespace std;
int main()
{
sqlite3 *database;
int check;
check = sqlite3_open("introdb3.db", &database); //error is here
}
我确定它有事情
I'm pretty sure that it has something to do with the libraries that are (or aren't) being linked, but I can't figure out how to make it go properly.
我在Ubuntu上使用了代码,因为它是(或不是)链接的库,但我不知道如何使它正常运行。 :: blocks。
I'm on Ubuntu using code::blocks.
谢谢!
推荐答案
/ p>
Instead of
#include <sqlite3ext.h>
写
#include <sqlite3.h>
只需要 sqlite3ext.h
如果你要写一个SQLite扩展 - 一个自定义函数,例如。对于常规数据库访问,请使用 sqlite3.h
。
The sqlite3ext.h
file is only needed if you are going to write an SQLite extension - a custom function, for example. For regular database access, use sqlite3.h
.
这篇关于'sqlite3_api'未在此作用域中声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!