Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error for Postgres #21

Open
i47320673 opened this issue Nov 17, 2022 · 3 comments
Open

Compile error for Postgres #21

i47320673 opened this issue Nov 17, 2022 · 3 comments

Comments

@i47320673
Copy link

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.

@znone
Copy link
Owner

znone commented Nov 21, 2022

This problem seems to be related to the PostgreSQL version.

@i47320673
Copy link
Author

I've not checked this for another (lower/upper) versions but for 12 that occurred.

@znone
Copy link
Owner

znone commented Nov 21, 2022

At that time, I used PostgreSQL 10.6 and debugged these header files for a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants