Page 1 of 1

Missing wxchar.h include in crashrpt.cpp?

Posted: Mon Nov 19, 2018 10:23 pm
by ebyrob
I may be doing something entirely wrong, but...

I tried to build latest 3.1.1.7 from source on Windows 7 using Visual Studio 2017. At first it seemed to mostly work but I got a strange error on command line:

Code: Select all

crashrpt.cpp
..\..\src\msw\crashrpt.cpp(170): error C3861: 'wxSscanf': identifier not found
I added

Code: Select all

#include "wx/wxchar.h"
to that file and everything continued working as normal.

Possibly there's some weird cascading error condition where a crash is supposed to get reported and instead this error crops up. Also, quite possibly my environment is just horribly messed up and crashrpt.cpp doesn't need that include at all.

Sorry if this is useless noise.

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Tue Nov 20, 2018 6:59 am
by doublemax
Which command line did you use?
Does it also happen if you use the project files to build?
Can you try again with the latest version from GIT?

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Tue Nov 20, 2018 7:02 am
by PB
First, I do not know what you mean by version 3.1.1.7, the current GIT master head defines version as

Code: Select all

#define wxMAJOR_VERSION      3
#define wxMINOR_VERSION      1
#define wxRELEASE_NUMBER     2
#define wxSUBRELEASE_NUMBER  0
#define wxVERSION_STRING   wxT("wxWidgets 3.1.2") 
Secondly, I build the master yesterday with MSVC 2017 (15.9) without any issues, in many configurations with provided nmake makefiles and also as 32-bit debug static and DLL with CMake generated MSVC 2017 project (including debugrpt sample).

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Tue Nov 20, 2018 7:02 pm
by ebyrob
@PB - sorry it was the 7 in 7zip.

So wxWidgets 3.1.1, NOT 3.1.1.7(zip)

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Tue Nov 20, 2018 7:05 pm
by ebyrob
> Which command line did you use?
NT batch, executing MSW makefile.vc using NMAKE.

> Does it also happen if you use the project files to build?
I don't think so.

> Can you try again with the latest version from GIT?
I will tonight. (maybe late)

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Tue Nov 20, 2018 7:10 pm
by PB
3.1.1 libraries (DLLs) built by MSVC 2017 are officially offered for download, so it seems unlikely that there is an issue, unless it was introduced by an MSVC update which while possible is not very likely.

I would make sure the installation went OK and cleared everything before trying to rebuild.

Edit
FWIW, I could build wxWidgets 3.1.1 libraries with latest stable MSVC 2017 (Desktop Express 15.9.2). Steps to reproduce
  • Downloaded and extracted the source code (wxWidgets-3.1.1.7z)
  • Opened build\msw\wx_vc15.sln
  • Built configuration Static Debug Win32
  • Built configuration DLL Release Win32
  • Built configuration for DLL Debug x64

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Wed Nov 21, 2018 3:24 am
by ebyrob
The latest master from git isn't building right now, something with can't find zlib. Not sure could try again tomorrow.

The problem seems likely due to this line in wxprec.h:

Code: Select all

#ifdef WX_PRECOMP
without that including wxprec.h does pretty much nothing, so wxchar.h would not be included at all which would cause this error.

I'd been messing around with CMAKE and I believe at one point I'd even run CMAKE in the wxWidgets folder which isn't recommended. So, yes the build itself works just fine when there is no problem. I was just thinking this may be a cascading failure that occurs only during error processing since I was causing one error but seeing symptoms of another. It now seems more likely that my compiler flags were just messed up (I was missing WX_PRECOMP which must be 100% required on MS Windows or I don't think crashrpt.cpp can possibly be compiled without it as currently written).

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Wed Nov 21, 2018 3:55 am
by New Pagodi
ebyrob wrote:The latest master from git isn't building right now, something with can't find zlib. Not sure could try again tomorrow.
You probably didn't include the submodules from the github repo. The following 2 notes from the "Building from Git Sources" might be helpful:
Please use --recurse-submodules option with the initial git clone. If you had already cloned the repository without this option, please run git submodule update --init to also get all 3rd party libraries code.

Before building from Git sources under Windows, you need to copy the file include/wx/msw/setup0.h to include/wx/msw/setup.h. This is necessary in order to allow having local modifications to the latter file without showing it as modified, as it is not under version control.

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Wed Nov 21, 2018 6:22 am
by PB
ebyrob wrote:I was missing WX_PRECOMP which must be 100% required on MS Windows or I don't think crashrpt.cpp can possibly be compiled without it as currently written).
I have never ever defined WX_PRECOMP anywhere, yet I have been successfully building wxWidgets since v2.9 in MANY configurations with nmake and GCC makefiles, MSVS solutions as well as CMake.

Re: Missing wxchar.h include in crashrpt.cpp?

Posted: Fri Oct 18, 2019 2:27 pm
by ebyrob
I'm sorry I left this topic open so long.

Just to follow up, I think I got it working for now by defining WX_PRECOMP. I don't entirely recall the outcome.