'sqlite3_api'未在此作用域中声明 [英] 'sqlite3_api' was not declared in this scope

查看:1103
本文介绍了'sqlite3_api'未在此作用域中声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆