+
Skip to content

Compile error for Postgres #21

@i47320673

Description

@i47320673

Hello.
Excellent library. Thank you.

I tried to build tests through GNU make.
I've got a lot compile time errors.

g++ -g -D_DEBUG -O2 -I/usr/include -I/usr/local/include -I/usr/include/postgresql -I/usr/include/postgresql/12/server -I../include -std=c++11 -x c++-header -o stdafx.h.gch stdafx.h
g++ -c -g -D_DEBUG -O2 -I/usr/include -I/usr/local/include -I/usr/include/postgresql -I/usr/include/postgresql/12/server -I../include -std=c++11 -o TestPostgres.o TestPostgres.cpp
In file included from /usr/include/postgresql/12/server/nodes/parsenodes.h:27,
from /usr/include/postgresql/12/server/utils/acl.h:36,
from /usr/include/postgresql/12/server/catalog/objectaddress.h:18,
from /usr/include/postgresql/12/server/catalog/pg_type.h:24,
from ../include/qtl_postgres.hpp:31,
from TestPostgres.cpp:8:
/usr/include/postgresql/12/server/nodes/primnodes.h:200:2: error: ‘Datum’ does not name a type; did you mean ‘outDatum’?
200 | Datum constvalue; /* the constant's value */
| ^~~~~
| outDatum
In file included from /usr/include/postgresql/12/server/utils/acl.h:37,
from /usr/include/postgresql/12/server/catalog/objectaddress.h:18,
from /usr/include/postgresql/12/server/catalog/pg_type.h:24,
from ../include/qtl_postgres.hpp:31,
from TestPostgres.cpp:8:
/usr/include/postgresql/12/server/parser/parse_node.h:263:2: error: ‘ErrorContextCallback’ does not name a type
263 | ErrorContextCallback errcallback;
| ^~~~~~~~~~~~~~~~~~~~
....

Software versions:

Ubuntu 20.04
GNU Make 4.2.1
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
postgresql-client-12 (12.12-0ubuntu0.20.04.1)
postgresql-client-common (214ubuntu0.1)
postgresql-server-dev-12:amd64 (12.12-0ubuntu0.20.04.1)
libpgtypes3:amd64 (12.12-0ubuntu0.20.04.1)
libecpg6:amd64 (12.12-0ubuntu0.20.04.1)
libecpg-compat3:amd64 (12.12-0ubuntu0.20.04.1)
libecpg-dev (12.12-0ubuntu0.20.04.1) …

Seems missing #include in <qtl/qtl_postgres.hpp>

//...
extern "C"
{
#include <postgres.h> // NEED THIS FOR COMPILE //
#include <c.h>
#include <catalog/pg_type.h>
}

//...

Building was finished OK after this addition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载