Failed to replicate the cpp example in the tutorial

Issue #45 resolved
Gan Saihua created an issue

Environment: Win10 WSL2 Linux

// main.cpp
#include <zdbpp.h>

using namespace zdb;

int main() {
    ConnectionPool pool("mysql://localhost:3306/test?user=root&password=root");
    pool.start();
}

$ g++ main.cpp -o test -L/usr/local/lib/ -lzdb -I/usr/local/include/zdb --std=c++17

In file included from main.cpp:1:
/usr/local/include/zdb/zdbpp.h:207:51: error: return type ‘class std::tuple<const void*, int>’ is incomplete
207 | std::tuple<const void*, int> getBlob(T v) {
| ^
/usr/local/include/zdb/zdbpp.h:327:69: error: ‘x’ has incomplete type
327 | void bind(int parameterIndex, std::tuple<const void *, int> x) {
| ~~~~~~^
In file included from /usr/include/c++/9/bits/move.h:55,
from /usr/include/c++/9/bits/stl_pair.h:59,
from /usr/include/c++/9/bits/stl_algobase.h:64,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/string:40,
from /usr/local/include/zdb/zdbpp.h:28,
from main.cpp:1:
/usr/include/c++/9/type_traits:2469:11: note: declaration of ‘class std::tuple<const void*, int>’
2469 | class tuple;
| ^

Comments (1)

  1. Log in to comment