Environment Variable is wrong in VS

Bryan Kelly 321 Reputation points
2022-07-26T01:31:00.097+00:00

Windows 11, Visual Studio 2019, C++
Start with the environment variable. Here is the dialog.

224691-environment-variable-wxwin.png

The logging was set here: Tools -> Options -> and the two verbosity fields set to Detailed. From the output, beginning at line 1018 is this segment:

1>VSLANG = 1033
1>VSSKUEDITION = Professional
1>windir = C:\WINDOWS
1>WXWIN = C:\WXWIDGETS\3.1.7
1>ZES_ENABLE_SYSMAN = 1

WXWIN is set to a value that was updated several weeks ago. As can be seen in the first image it is C:\WXWIDGETS/3.2.0
But Visual Studio is using the wrong value.
I’ll even post a screen capture from that section of the Output panel.

224684-wxwin-is-wrong.png

What might have caused this and how can it be corrected?

Side question: are there any allowed tags for Visual Studio. Typing in "vi" or "vs" results in nothing so I use C++

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,638 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,542 questions
0 comments No comments
{count} votes

10 answers

Sort by: Most helpful
  1. RLWA32 40,771 Reputation points
    2022-07-26T08:42:16.66+00:00

    Well, the first question is whether or not you use VS2019 with the same user account for which you set the user environment variables?

    How do you start the VS2019 IDE (devenv.exe)? I was able to reproduce this by using a batch file that changed the WXWIN environment variable that was passed to VS2019 when it started. The change was only visible in the batch file's command prompt window and any processes started from it.

    However, the wxwidget project file that I tested in this altered environment still built successfully. Upon examining the project file in notepad I saw that the correct path to the wxwidgets.props property sheet was contained in the file -

    224765-wxbryanprops.png

    From VS diagnostics -

    224773-msbuild1.png

    But note the property sheet path containing the correct 3.2.0 value.

    224690-msbuild2.png

    Have you seen the additional diagnostic procedures that I posted for you here -

    https://learn.microsoft.com/en-us/answers/questions/939636/exactly-what-is-the-problem-here.html

    0 comments No comments

  2. Bryan Kelly 321 Reputation points
    2022-07-26T14:55:33.973+00:00

    I use only one login. No one else uses this computer. It is at home on a private network. I do not use admin account for anything but changes such as installs.
    The VS icon was put in my taskbar upon install. It is started with a single click on that icon. A few times it has been started by clicking on a solution, but that is seldom. Those are the only two ways it is started. I am not an "experienced or knowledgeable" VS user.

    Re: However, the wxwidget project file that I tested in this altered environment still built successfully.

    Do you have 3.1.7 on your computer? I do not, only 3.2.0. When WXWIN is set wrong, I don't see how it could build the problem successfully.

    After finding 3.1.7 I in the Output I stopped looking. Bad move on my part. I looked again at the Output file and also found multiple occurrences of 3.2.0. Still, it seems to me there should be no occurrences of the 3.1.7 path.

    I have some urgent tasks but will be looking at the diagnostic procedure shortly.


  3. RLWA32 40,771 Reputation points
    2022-07-27T11:25:25.55+00:00

    In your system's environment variables dialog select the System Path variable, click edit and post the displayed results. Do the same for the User Path variable.

    0 comments No comments

  4. Bryan Kelly 321 Reputation points
    2022-07-27T13:55:35.92+00:00

    The System Path variable, from the bottom of the two dialogs is:

    225279-system-path-variable.png

    The User Path variable, from the top of the two dialogs is

    225343-user-path-variable.png

    I am beyond frustrated at my inability to get this working. I am ready to pay you, any reader, to build a Windows 11 boot disk with Visual Studio, and with wxWidgets working. I will provide all the expenses for the hardware (the SSD boot drive), the licenses, and as a starting point $100 for the working system.
    Beyond that, I am deeply grateful for to you, RLWA32-6355 for the time and patience you have shown me in this endeavor.


  5. Bryan Kelly 321 Reputation points
    2022-07-28T02:14:31.367+00:00

    I plead mea culpa. I was not aware of administrator versus user environment variables. I finally got the hint, searched a bit, and discovered the situation.

    I still have some additional hints to follow from these threads.

    Since I am here, what kinds of paths belong in the user environment variable Path?

    I cannot resolve this error: Cannot open include file: 'wx/setup.h'

    A file by that name is found here:

    "C:\WXWIDGETS\3.2.0\include\msvc\wx\setup.h"  
    

    When edited the opening comments include:

     Name:        msvc/wx/setup.h  
    // Purpose:     wrapper around the real wx/setup.h for Visual C++  
    

    That seems to be the one the code needs. At least I think so.
    Go here: Project -> Properties -> VC++ Directories and field: Include Directories. It contains this:

    C:\WXWIDGETS\3.2.0\include\msvc;$(IncludePath)

    When I postfix the first segment of that with the missing file we have:

    C:\WXWIDGETS\3.2.0\include\msvc\wx/setup.h

    That is the path to the file that VS declares "no such file or directory"
    I suspect, and hope, the switch between \ and / does not spoil the path.

    What might I have wrong?