Unknown type name bool

Started by Igal Sapirover 6 years ago6 messages
#1Igal Sapir
igal@lucee.org

I am trying to build Postgres in an IDE (CLion on Ubuntu), and I'm getting
the following error message:

In file included from /workspace/src/postgres/src/include/c.h:61:0,
from /workspace/src/postgres/src/include/postgres.h:46,
from /workspace/src/postgres/contrib/bloom/blcost.c:13:
/workspace/src/postgres/src/include/common/string.h:13:8: error: unknown
type name ‘bool’
extern bool pg_str_endswith(const char *str, const char *end);

CLion created a CMakeLists.txt file with the following at the top:

cmake_minimum_required(VERSION 3.14)
project(postgres)
set(CMAKE_CXX_STANDARD 14)

And my compiler version is: gcc version 7.4.0 (Ubuntu
7.4.0-1ubuntu1~18.04.1)

Any thoughts? (disclaimer: I have much more experience with Java than C)

Thanks,

Igal

#2Michael Paquier
michael@paquier.xyz
In reply to: Igal Sapir (#1)
Re: Unknown type name bool

On Thu, Jul 11, 2019 at 10:21:06PM -0700, Igal Sapir wrote:

Any thoughts? (disclaimer: I have much more experience with Java than C)

We don't support cmake directly. Here is the documentation about how
to build the beast:
https://www.postgresql.org/docs/current/install-procedure.html
--
Michael

#3Igal Sapir
igal@lucee.org
In reply to: Michael Paquier (#2)
Re: Unknown type name bool

On Thu, Jul 11, 2019 at 10:27 PM Michael Paquier <michael@paquier.xyz>
wrote:

On Thu, Jul 11, 2019 at 10:21:06PM -0700, Igal Sapir wrote:

Any thoughts? (disclaimer: I have much more experience with Java than C)

We don't support cmake directly. Here is the documentation about how
to build the beast:
https://www.postgresql.org/docs/current/install-procedure.html

Thank you, Michael, but my goal is not to just build from source, but to
run Postgres in an IDE. I tried CLion because it's modern and cross
platform, but I am open to other IDEs.

What IDEs do Postgres hackers use (other than vi with gcc)? Is there any
documentation or posts on how to set up the project in an IDE?

Thanks,

Igal

#4Gavin Flower
GavinFlower@archidevsys.co.nz
In reply to: Igal Sapir (#3)
Re: Unknown type name bool

On 12/07/2019 17:54, Igal Sapir wrote:

On Thu, Jul 11, 2019 at 10:27 PM Michael Paquier <michael@paquier.xyz
<mailto:michael@paquier.xyz>> wrote:

On Thu, Jul 11, 2019 at 10:21:06PM -0700, Igal Sapir wrote:

Any thoughts?  (disclaimer: I have much more experience with

Java than C)

We don't support cmake directly.  Here is the documentation about how
to build the beast:
https://www.postgresql.org/docs/current/install-procedure.html

Thank you, Michael, but my goal is not to just build from source, but
to run Postgres in an IDE.  I tried CLion because it's modern and
cross platform, but I am open to other IDEs.

What IDEs do Postgres hackers use (other than vi with gcc)?  Is there
any documentation or posts on how to set up the project in an IDE?

Thanks,

Igal

I'm not a pg hacker.

However, I'd use Eclipse -- but I don't do much programming these days.

Real Programmers use emacs.  I used emacs very successfully for
programming in C over twenty years ago.  If you're willing to put in the
effort, emacs is worth it.

Both emacs & Eclipse have integrated debuggers.   As I suspects all
modern IDE's do.  :-)

I wouldn't use vi.

Cheers,
Gavin

#5Michael Paquier
michael@paquier.xyz
In reply to: Igal Sapir (#3)
Re: Unknown type name bool

On Thu, Jul 11, 2019 at 10:54:53PM -0700, Igal Sapir wrote:

Thank you, Michael, but my goal is not to just build from source, but to
run Postgres in an IDE. I tried CLion because it's modern and cross
platform, but I am open to other IDEs.

What IDEs do Postgres hackers use (other than vi with gcc)?

A set of N people would likely result in more than (N+1) different
approaches when it comes to that. The environment is old school here
as I just have a set of terminals coupled with emacs as editor and
gcc/clang, but you have a large set of editors at your disposal (nano,
vi, etc.).

Is there any documentation or posts on how to set up the project in an IDE?

It depends on what you are actually trying to do and how you want to
ease your development experience. I have little experience with CLion
or such kind of tools, some with Eclipse, but I find that kind of
cumbersome as well when it comes to C.
--
Michael

#6Igal Sapir
igal@lucee.org
In reply to: Michael Paquier (#5)
Re: Unknown type name bool

On Thu, Jul 11, 2019 at 11:14 PM Michael Paquier <michael@paquier.xyz>
wrote:

On Thu, Jul 11, 2019 at 10:54:53PM -0700, Igal Sapir wrote:

Thank you, Michael, but my goal is not to just build from source, but to
run Postgres in an IDE. I tried CLion because it's modern and cross
platform, but I am open to other IDEs.

What IDEs do Postgres hackers use (other than vi with gcc)?

A set of N people would likely result in more than (N+1) different
approaches when it comes to that. The environment is old school here
as I just have a set of terminals coupled with emacs as editor and
gcc/clang, but you have a large set of editors at your disposal (nano,
vi, etc.).

I'd actually be happy with (N+1) different approaches. It will allow me,
and others like, to choose the one that works for us best.

Is there any documentation or posts on how to set up the project in an

IDE?

It depends on what you are actually trying to do and how you want to
ease your development experience. I have little experience with CLion
or such kind of tools, some with Eclipse, but I find that kind of
cumbersome as well when it comes to C.

At the moment I am trying to run psql in a debugger with breakpoints. I
have spent many hours troubleshooting a `\copy` from a large CSV that kept
failing, until I realized that there was a null character in the middle of
a quoted string. I'd be happy to submit a patch that at least warns of
such issues when they happen.

Thanks,

Igal