3

I'm trying compile pgbouncer to use in a PostgreSQL server running in windows server 2008. However I simply can't compile the dll, and the same error appears in linux (ubuntu) and in windows:

checking for libevent... configure: error: not found: cannot proceed

I'm following this howto. I've compiled the libevent in windows using mingw and copied the dlls generated to System32, SysWOW64 and even in own pgbouncer directory. What am I doing wrong?

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182
brevleq
  • 2,081
  • 10
  • 53
  • 97
  • 2
    Never copy random dll's to `C:\Windows`. That's terrible in all ways possible. – rubenvb Oct 29 '15 at 09:00
  • For Windows, if at all possible find prebuilt binaries. For Linux, install pgbouncer from packages; see apt.postgresql.org and yum.postgresql.org – Craig Ringer Oct 29 '15 at 09:13

3 Answers3

4

configure is checking whether it will be possible for the package build to link libevent. For that it needs see that libevent development dependencies are satisfied. It checks not only that libevent itself can be found for linkage but that the header <event.h> (exactly like that) can be found for compilation.

For configure to succeed you must make sure that:-

  • event.h from your libevent package will be found in the default or configured include-search paths of the compiler.

  • The libevent binary will be found in the default or configured library-search paths of the linker.

Near the top of the HowTo that you have referred to you will see that configure accepts a parameter --with-libevent=libevent-prefix that can make this easy. ./configure --help says:

--with-libevent=prefix  Specify where libevent is installed

For your ubuntu system the short answer would be: install libevent-dev from the package manager. In Ubuntu you could also install pgbouncer from the package manager, but perhaps you want the latest version.

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182
  • Thank you. I've added prefix and reinstalled libevent in windows. Then used that in --with-libevent. – brevleq Oct 29 '15 at 11:38
2

You need to install libevent-devel, that supplies 2 event.h files:

# find / -name event.h 2>/dev/null 
/usr/include/event.h
/usr/include/event2/event.h

To install run:

yum install libevent-devel.x86_64
Rogerlr
  • 121
  • 4
0

If you want to compile pgBouncer for Windows, follow my instructions under https://sepppenner.github.io/PgBouncerWinBinaries/ or https://github.com/SeppPenner/PgBouncerWinBinaries.

FranzHuber23
  • 3,311
  • 5
  • 24
  • 63