Trying to compile pgAgent. Get an error wx/setup.h: No such file or directory

542 Views Asked by At

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 
0

There are 0 best solutions below