RHEL8 Got error: iso-8859-1 type name ‘sigjmp_buf’ while compiling C simple code after including pg_type.h

Поиск
Список
Период
Сортировка
От Bonu, Miriam, Sony Music Italy
Тема RHEL8 Got error: iso-8859-1 type name ‘sigjmp_buf’ while compiling C simple code after including pg_type.h
Дата
Msg-id VI1PR0202MB289684F0AEB3C2FCD9BB1199A1849@VI1PR0202MB2896.eurprd02.prod.outlook.com
обсуждение исходный текст
Ответы Re: RHEL8 Got error: iso-8859-1 type name ‘sigjmp_buf’ while compiling C simple code after including pg_type.h
Список pgsql-bugs

Hello

 

I’m doing some practice with libpq libraries and I need your help to solve an issue that appeared after I tried to add “pg_type.h” on my source code.

 

I’m working on RHEL 8.6 environment, with following libpq:

[pgtestdb]/pgtest/postgres>rpm -q postgresql14-devel

postgresql14-devel-14.7-1PGDG.rhel8.x86_64

 

To check the problem I’ve created a simple C program, named test.c:

 

#include <stdio.h>

#include <stdlib.h>

#include <stdint.h>

#include <string.h>

#include <sys/types.h>

 

/* for ntohl/htonl */

#include <netinet/in.h>

#include <arpa/inet.h>

 

/* for Postgres */

//#include <setjmp.h>

#include "libpq-fe.h"

//#include "catalog/pg_type.h"

 

int

main(int argc, char **argv)

{

        printf("test!!\n");

        return 0;

}                               

 

I’m using following command to compile:

 

cc -o test test.c -I/usr/pgsql-14/include -I/usr/pgsql-14/include/server -L/usr/pgsql-14/lib -lpq  -v -std=c99

 

If I compile this, it works fine (see test_comp1.log):

[pgtestdb]/pgtest/postgres>./test

test

 

but I remove the comment to //#include "catalog/pg_type.h" I get many errors like: unknown type name ‘uint32’

(see test_comp2.log)

 

Searching in the internet forums, I found that those errors could be solved by adding "c.h" and "postgres.h"

includes, but, if I do it, I obtain another error:  error: unknown type name ‘sigjmp_buf’

(see test_comp3.log)

 

I found that a definition of  sigjmp_buf’  is included in  /usr/include/setjmp.h, so I added the include to “setjmp.h”, but I got same error.

(see test_comp4.log)

 

Can you please help me to solve this issue?

 

Thanks and regards,

Miriam

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Andrey Lizenko
Дата:
Сообщение: Re: BUG #17863: Unable to restore dump 12.12 -> 15.2
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: BUG #17867: pg_dump intermittently hangs