setup.h errors when running nmake with VS command line Topic is solved

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
User avatar
mloutris
In need of some credit
In need of some credit
Posts: 7
Joined: Mon Feb 19, 2018 3:08 pm

setup.h errors when running nmake with VS command line

Post by mloutris »

I am trying to build wxWidgets from source for Visual Studio Community 2019.

I have a Windows 10 Lenovo IdeaPad S340 and I downloaded and unzipped wxWidgets-3.1.4 into C:\wxWidgets-3.1.4

I defined the system variable WXWIN to be C:\wxWidgets-3.1.4

To build, I am using the instructions on https://docs.wxwidgets.org/trunk/plat_msw_install.html
All makefiles and project are located in build directory.

Microsoft Visual C++ Compilation
From command line using the provided makefiles:
0. Open a "Visual Studio Command Prompt" window shortcut to which must have been installed to the "Start" menu or the "Start" screen by MSVS installation.

Change directory to %WXWIN% and type

> nmake /f makefile.vc
to build wxWidgets in the default debug configuration as a static library.

Since the makefile is actually located in the platform specific directory under build, I ran nmake as follows:
nmake /f build\msw\makefile.vc

When I do that, I get the following error:
if not exist ..\..\include\wx\msw\setup.h copy ..\..\include\wx\msw\setup0.h ..\..\include\wx\msw\setup.h
The system cannot find the path specified.
NMAKE : fatal error U1077: 'if' : return code '0x1'
Stop.
However, I can see that the file is clearly there.
Please see the image at the bottom of this post.

I also noticed that makefile.vc contains the lines:
!if "$(WXUNIV)" == "0"
__SETUP_H_SUBDIR_FILENAMES = msw
!endif
!if "$(WXUNIV)" == "1"
__SETUP_H_SUBDIR_FILENAMES = univ
!endif
I created a system variable WXUNIV and set it to 0 (zero)
but that didn't help.

Does anyone know what I'm doing wrong?
Thanks!

Image
Attachments
Screenshot 2021-03-11 155325.png
Screenshot 2021-03-11 155325.png (6.75 KiB) Viewed 3150 times
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: setup.h errors when running nmake with VS command line

Post by doublemax »

Code: Select all

nmake /f build\msw\makefile.vc
Enter the directory and just use

Code: Select all

nmake /f makefile.vc
I am trying to build wxWidgets from source for Visual Studio Community 2019.
Just out of curiosity: Why are you not using the solution files for the IDE?
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: setup.h errors when running nmake with VS command line

Post by ONEEYEMAN »

Hi,
Do this:

Code: Select all

cd c:\wxWidgets-3.1.4\build\msw
nmake -f makefile.vc
Thank you.
User avatar
mloutris
In need of some credit
In need of some credit
Posts: 7
Joined: Mon Feb 19, 2018 3:08 pm

Re: setup.h errors when running nmake with VS command line

Post by mloutris »

doublemax wrote: Thu Mar 11, 2021 10:43 pm

Code: Select all

nmake /f build\msw\makefile.vc
Enter the directory and just use

Code: Select all

nmake /f makefile.vc
I am trying to build wxWidgets from source for Visual Studio Community 2019.
Just out of curiosity: Why are you not using the solution files for the IDE?
Just to be able to build it. At some point, if I feel I can contribute something back, this will be a good first step.
And thank you for the suggestion!
It's building as we speak.
-Mike
User avatar
mloutris
In need of some credit
In need of some credit
Posts: 7
Joined: Mon Feb 19, 2018 3:08 pm

Re: setup.h errors when running nmake with VS command line

Post by mloutris »

ONEEYEMAN wrote: Thu Mar 11, 2021 10:44 pm Hi,
Do this:

Code: Select all

cd c:\wxWidgets-3.1.4\build\msw
nmake -f makefile.vc
Thank you.
Thank you, it worked!
And I was able to build and run the minimal example using Visual Studio!
Post Reply