Missing define in makefile.vc for dataview sample in wx313 causes failure

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Frank_WX
Earned a small fee
Earned a small fee
Posts: 12
Joined: Fri Aug 03, 2018 10:20 pm

Missing define in makefile.vc for dataview sample in wx313 causes failure

Post by Frank_WX » Mon Dec 16, 2019 10:12 pm

After importing sample makefile.vc into Codeblocks IDE, i can 'clean' it, but 'build' or 'reduild fails with the following error:

Code: Select all

-------------- Build: Debug x64 in dataview (compiler: mvc x64)---------------

Checking if target is up-to-date: nmake.exe -q -f c:\wxwidg~1.3\samples\dataviewcbvcmake2\makefile.vc TARGET_CPU=X64 all
Running command: nmake.exe -f c:\wxwidg~1.3\samples\dataviewcbvcmake2\makefile.vc TARGET_CPU=X64 all
Microsoft (R) Program Maintenance Utility Version 14.24.28314.0
Copyright (C) Microsoft Corporation.  All rights reserved.
	cl /c /nologo /TP /Fovc_mswud_x64\dataview_dataview.obj /MDd /DWIN32  /Zi /Fdvc_mswud_x64\dataview.pdb /D_DEBUG  /Od /DNULL=0 /D_CRT_SECURE_NO_DEPRECATE=1  /D_CRT_NON_CONFORMING_SWPRINTFS=1 /D_SCL_SECURE_NO_WARNINGS=1   /D__WXMSW__         /D_UNICODE /I.\..\..\lib\vc_x64_lib\mswud  /I.\..\..\include /I. /I.\..\..\samples /I.\..\..\2019\Community\VC\Tools\MSVC\14.24.28314\atlmfc\include /I.\..\..\2019\Community\VC\Tools\MSVC\14.24.28314\include  /I.\..\..\10\Include\10.0.18362.0\cppwinrt /I.\..\..\10\Include\10.0.18362.0\shared /I.\..\..\10\Include\10.0.18362.0\ucrt /I.\..\..\10\Include\10.0.18362.0\um /I.\..\..\10\Include\10.0.18362.0\winrt   /W4 /MP   /D_WINDOWS /DNOPCH /GR /EHsc    .\dataview.cpp
dataview.cpp
C:\wxWidgets-3.1.3\include\wx/defs.h(707): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.EXE"' : return code '0x2'
Stop.
Process terminated with status 2 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Inside defs.h it states:
/* NULL declaration: it must be defined as 0 for C++ programs (in particular, */
/* it must not be defined as "(void *)0" which is standard for C but completely */
/* breaks C++ code) */
#include <stddef.h>
The statement may not really apply, since that point in defs.h wouldn't have been reached, but for the missing define. stddef.h doesn't exist in wx313.

This in for Windows 10 Home, on a 64-bit system. All the defines used are reflected in the included build log.

Regards,
Frank :?: :?: :?:

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 373
Joined: Fri Nov 03, 2006 2:00 pm

Re: Missing define in makefile.vc for dataview sample in wx313 causes failure

Post by stahta01 » Tue Dec 17, 2019 1:17 am

This is not an wxWidgets problem; this is a toolchain not being configured correctly.

Tim S.

Frank_WX
Earned a small fee
Earned a small fee
Posts: 12
Joined: Fri Aug 03, 2018 10:20 pm

Re: Missing define in makefile.vc for dataview sample in wx313 causes failure

Post by Frank_WX » Tue Dec 17, 2019 3:47 am

@stahta01:

What's wrong with the toolchain configuration on codeblocks? I've successfully used makefiles, for this sample, with both GCC and VC from the command line. I also used a makefile with VS2019 and it worked. Since you also claim you're a solver for codeblocks, I'd appreciate some enlightenment?!

Regards,
Frank

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 373
Joined: Fri Nov 03, 2006 2:00 pm

Re: Missing define in makefile.vc for dataview sample in wx313 causes failure

Post by stahta01 » Tue Dec 17, 2019 7:22 pm

Your makefile can not find a standard compiler header; therefore the compiler/toolchain setting are wrong!

Edit: I would first look inside the makefile before blaming Code::Blocks.
Next, run the makefile from the command line to be sure it works.
Then, the problem likely would be inside Code::Blocks.

Tim S.

Frank_WX
Earned a small fee
Earned a small fee
Posts: 12
Joined: Fri Aug 03, 2018 10:20 pm

Re: Missing define in makefile.vc for dataview sample in wx313 causes failure

Post by Frank_WX » Wed Dec 18, 2019 9:41 pm

Hello,

stddef.h is provided as part of Microsoft's SDK for Windows 10. I've replaced it. Have run the makefile outside of the codeblocks IDE; without any problems. Codeblocks IDE still hiccups, asking for stddef.h.

Am addressing the toolchain possibly being mis-configed by following a codeblocks wiki article about integrating a Visual C++ compiler with codeblocks for a AMD 64-bit compiler. This is using a newer version of the software and is much more detailed than what I did a few years ago.

@stahta01/Tim S: Thanks! Good info about codeblocks and not being able to find a header.

Regards,
Frank :D :D :D

Post Reply