wx/setup.h: No such file or directory

3,765 views
Skip to first unread message

Arturas Mazeika

unread,
May 22, 2018, 11:51:15 AM5/22/18
to wx-users
Hi All,


I am trying to build pgAdmin 3.4.0 (that uses/is based on wxWidgets 2.8) using Visual Studio Community Edition 2017 (VS). I successfully downloaded the 2.8 version and built it with VS using the wx_vc15.sln file. I created a VS solution file for pgAgest using CMake. When I try to compile it, I get the error:


wx/setup.h: No such file or directory


How can I address the problem? There are quite a few links on the web on the issue, but I cannot nail it down. Additional steps and infos can be found at


Cheers,
Arturas



Gunter Königsmann

unread,
May 22, 2018, 11:56:22 AM5/22/18
to wx-u...@googlegroups.com
Normally a missing setup.h means that you didn't compile your wxWidgets for exactly the setup your application is compiled with (wxWidgets unicode support,...)

How exactly did you build wxWidgets and do you build your application?

Kind regards,
     Gunter.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to wx-users+u...@googlegroups.com
or visit http://groups.google.com/group/wx-users

Vadim Zeitlin

unread,
May 22, 2018, 12:16:27 PM5/22/18
to wx-u...@googlegroups.com
On Tue, 22 May 2018 08:36:15 -0700 (PDT) Arturas Mazeika wrote:

AM> I am trying to build pgAdmin 3.4.0 (that uses/is based on wxWidgets 2.8)
AM> using Visual Studio Community Edition 2017 (VS). I successfully downloaded
AM> the 2.8 version and built it with VS using the wx_vc15.sln file. I created
AM> a VS solution file for pgAgest using CMake. When I try to compile it, I get
AM> the error:
AM>
AM>
AM> wx/setup.h: No such file or directory
AM>
AM>
AM> How can I address the problem? There are quite a few links on the web on
AM> the issue, but I cannot nail it down. Additional steps and infos can be
AM> found at
AM>
AM> https://stackoverflow.com/questions/50469351/trying-to-compile-pgagent-get-an-error-wx-setup-h-no-such-file-or-directory

This link indicates that the missing file is lib/vc_lib/mswd/wx/setup.h
which means that you're building pgAdmin in non-Unicode mode, while you
probably built wxWidgets in default, Unicode, mode which only generated the
file lib/vc_lib/mswud/wx/setup.h (notice the extra "u").

If this is indeed the problem, then the solution is to either build
pgAdmin in Unicode (if it supports it) or build wxWidgets in non-Unicode
mode.

If it's not that, please check the contents of your "lib" directory to
check how exactly did you build wxWidgets.

Good luck,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Arturas Mazeika

unread,
May 23, 2018, 2:13:05 AM5/23/18
to wx-u...@googlegroups.com
Hi Vadim,
hi Gunter,
hi wx Users,

Thanks for the feedback (question on details how I exactly build pgAdmin and wxWidgets and unicode). This is helpful. I'll try to dig into it a bit (and the fact that I can only write this on only general level shows that I'd need to dig quite a bit into this). Hopefully I'll be able to come back with good news :-)

Cheers,
Artuars

Arturas Mazeika

unread,
May 29, 2018, 6:07:52 AM5/29/18
to wx-users
Hi Gunter, Vadim, wx Users,

Your questions brought quite a bit of light into the darkness and I have managed to compile pgAgent with some version of wxWidgets successfully. I am still learning quite a bit with some things working and some don't, hence the Email. Maybe you could help me out a bit to advance my knowledge about the library a bit. So here's what works and what doesn't.

(1) I successfully downloaded and installed Visual Studio 2017 Community Edition
(2) I successfully downloaded and extracted wxWidgets-3.1.1
(3) I opened the \build\msw\wx_vc15.sln with Visual Studio 2017 and

Vadim Zeitlin

unread,
May 29, 2018, 6:49:26 AM5/29/18
to wx-u...@googlegroups.com
On Tue, 29 May 2018 02:23:33 -0700 (PDT) Arturas Mazeika wrote:

AM> Hi Gunter, Vadim, wx Users,
AM>
AM> Your questions brought quite a bit of light into the darkness and I have
AM> managed to compile pgAgent with some version of wxWidgets successfully. I
AM> am still learning quite a bit with some things working and some don't,
AM> hence the Email. Maybe you could help me out a bit to advance my knowledge
AM> about the library a bit. So here's what works and what doesn't.
AM>
AM> (1) I successfully downloaded and installed Visual Studio 2017 Community
AM> Edition
AM> (2) I successfully downloaded and extracted wxWidgets-3.1.1
AM> (3) I opened the \build\msw\wx_vc15.sln with Visual Studio 2017 and

Just for the reference, your email seems to have been truncated as it
abruptly stops here.

Regards,

Arturas Mazeika

unread,
May 30, 2018, 2:57:39 AM5/30/18
to wx-users
Hi All,

unfortunately my last message got cut. Sorry about that. Let me continue with the line "So here's what works and what doesn't."


So here's what works and what doesn't.

(1) I successfully downloaded and installed Visual Studio 2017 Community Edition

(2) I successfully downloaded and extracted wxWidgets-3.1.1
(3) I opened the \build\msw\wx_vc15.sln with Visual Studio 2017
(4) I was able to successfully compile the Release/Debug win32 Unicode version of the library
(5) I've updated the charset settings all the sub-projects in the to be "not set" (to build a non-unicode version of the library)
(6) I am able to compile it neither in Debug nor in Release settings anymore.

The error was:

7>regcomp.c
7>regerror.c
7>regexec.c
7>regfree.c
7>f:\pgbuild\wxwidgets-3.1.1\include\wx\platform.h(148): fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory (compiling source file ..\..\src\regex\regexec.c)
7>f:\pgbuild\wxwidgets-3.1.1\include\wx\platform.h(148): fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory (compiling source file ..\..\src\regex\regerror.c)
7>f:\pgbuild\wxwidgets-3.1.1\include\wx\platform.h(148): fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory (compiling source file ..\..\src\regex\regfree.c)
7>f:\pgbuild\wxwidgets-3.1.1\include\wx\platform.h(148): fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory (compiling source file ..\..\src\regex\regcomp.c)
6>wx_wxscintilla.vcxproj -> F:\pgbuild\wxWidgets-3.1.1\build\msw\..\..\lib\vc_lib\wxscintillad.lib
7>Done building project "wx_wxregex.vcxproj" -- FAILED.

Comments?

Cheers,
Arturas

Gunter Königsmann

unread,
May 30, 2018, 3:25:15 AM5/30/18
to wx-u...@googlegroups.com
My guess would be: you have successfully compiled wxWidgets with unicode. But when compiling your application the macro that informs wxWidgets that it needs to support unicode wasn't defined. Finding this switch cost me a week of debugging once - which caused my working place to switch to qt which means that I bo more have documentation on how to compile for wxWidgets on windows.

--

Arturas Mazeika

unread,
May 30, 2018, 3:35:38 AM5/30/18
to wx-u...@googlegroups.com
Hi Gunter,

Thanks for a quick reply. You've been switching to QT? I know this feeling :-)

But coming back to the issue: yes, you are right. I am able to successfully compile the wxWidgets library with unicode. And I am not able to compile the wxWidgets library in non-unicode settings. I haven't event touched the code of my library/application. So up till now it is pure wxWidgets..

Cheers,
Arturas

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 

Gunter Königsmann

unread,
May 30, 2018, 4:23:13 AM5/30/18
to wx-u...@googlegroups.com


Arturas Mazeika <maz...@gmail.com> schrieb am Mi., 30. Mai 2018, 09:35:
Hi Gunter,

Thanks for a quick reply. You've been switching to QT? I know this feeling :-)

Actually I think switching to qt is the wrong decision: qt is big, isn't real c++ and never exactly matches the current system's style (unless the system uses KDE)...

But coming back to the issue: yes, you are right. I am able to successfully compile the wxWidgets library with unicode. And I am not able to compile the wxWidgets library in non-unicode settings. I haven't event touched the code of my library/application. So up till now it is pure wxWidgets..

I think I found it again: you need to tell visual studio to define the symbol wxUSE_UNICODE to be 1 when compiling your application and it will request the unicode build (that you have created). 

If this works: where did you search first when encountering this problem. Perhaps we can add documentation somewhere.

Kind regards, Gunter.



Cheers,
Arturas

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 

Vadim Zeitlin

unread,
May 30, 2018, 7:16:06 AM5/30/18
to wx-u...@googlegroups.com
On Tue, 29 May 2018 23:57:38 -0700 (PDT) Arturas Mazeika wrote:

AM> So here's what works and what doesn't.
AM>
AM> (1) I successfully downloaded and installed Visual Studio 2017 Community
AM> Edition
AM> (2) I successfully downloaded and extracted wxWidgets-3.1.1
AM> (3) I opened the \build\msw\wx_vc15.sln with Visual Studio 2017
AM> (4) I was able to successfully compile the Release/Debug win32 Unicode
AM> version of the library
AM> (5) I've updated the charset settings all the sub-projects in the to be
AM> "not set" (to build a non-unicode version of the library)

It doesn't work like this. If you absolutely need to build ANSI version of
the library (but if you're just starting with wxWidgets, you definitely
don't, the ANSI build only exists for compatibility reasons), you should
do it using nmake from command line and pass UNICODE=0 to it.

But, again, for emphasis: you don't want, need or should build the
non-Unicode version of wxWidgets in 2018. Just don't do this.
Reply all
Reply to author
Forward
0 new messages