0

On one of our servers pgAgent service does not start with the message "ERROR: Couldn't register event handle" (see DBA Question). So I decided to compile the binary from the source, to further investigate the problem.

I installed Visual Studio Community 2017 Edition. I downloaded pgagent source code 3.4.0 and extracted to F:\pgbuild\pgAgent-3.4.0. I downloaded the wxWidgets 2.8, unpacked into F:\pgbuild\wxWidgets and built with visual studio 2017. I pointed out the these variables

wxMSW=F:\pgbuild\wxWidgets
WXWIN=F:\pgbuild\wxWidgets
PGDIR=C:\Program Files\PostgreSQL\9.6
WIX=C:\Program Files (x86)\WiX Toolset v3.11\

Then I tried to compile the pgAgent. Visual studio could recognize the CMake Project of it. When I compile the cmake project, I get an error:

Severity    Code    Description Project File    Line    Suppression State
Error   C1083   Cannot open include file: '../../../lib/vc_lib/mswd/wx/setup.h': No such file or directory  F:\pgbuild\pgAgent-3.4.0\CMakeLists.txt F:\pgbuild\wxWidgets\include\msvc\wx\setup.h    123

There are lots of urls around the problem on the net, but I cannot get a handle on it.

It looks to me that this code needs to be updated:

#ifdef wxSUFFIX
    #define wxSETUPH_PATH \
        wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h)
#else // suffix is empty
    #define wxSETUPH_PATH \
        wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, /wx/setup.h)
#endif

I built wxWidgets using wx_vc15.sln in F:\pgbuild\wxWidgets\build\msw. I was trying to build pgAgent as CMake project, although the building instructions say that I need to use the GUI version of CMake.

I was following instructions to build pgAdmin, but now I am wondering whether I need to build pgAdmin (don't mix it up vs. pgAgent) at all.

Any suggestions how?

Update:

I installed CMake for Windows and created a solution file to F:/pgbuild/pgAgent-3.4.0/build. Got some errors lines back:

Cmake screenshot

Then clicked on configure, then on gnerate. This created the visual studio project file. Tried to build it, got the error above (wx/setup.h: No such file or directory). The exact error is

Severity    Code    Description Project File    Line    Suppression State
Error   C1083   Cannot open include file: '../../../lib/vc_dll/mswd/wx/setup.h': No such file or directory  pgagent f:\pgbuild\wxwidgets\include\msvc\wx\setup.h    123 
arthur
  • 1,034
  • 2
  • 17
  • 31
  • did you first generate the solution/makefile or you just compiled pgagent? Also, did you follow some instructions on how to build? If yes - can you post the link? Finally - how did you build wxWidgets - using command line or through the IDE? Which configuration did you build? – Igor May 22 '18 at 14:26
  • @igor: nice comments. Updated the task description, and trying to investigate the problem further. – arthur May 22 '18 at 15:05
  • You may want to consider posting your question to the pgsql-hackers mailing list. – Mark Rotteveel May 22 '18 at 15:15
  • @Arthur, as Vadim and Gunter suggested, most likely there is a mismatch between wxWidgets build and pgAgent build. Please check Vadim reply and follow on the wx' ML. Also, make sure thaqt you are actually working with wx 2.8 and this is the exact wx version you (pgAgent) requires. – Igor May 22 '18 at 17:01

0 Answers0