Build fails in release mode

Bryan Kelly 486 Reputation points
2022-07-17T20:36:26.227+00:00

I am far from expert in VS so please be explicit
Windows 11, Visual Studio 2019, C++

Trying to learn wxWidgets. The basic Hello World file compiles in debug but not in release.
The first few lines look like this.
221557-wxwidget-first-few.png
I have tried changing PATH, and the properties pages
221626-widget-properties.png

For example wxprec.h is found here:

C:\WXWIDGETS\3.2.0\include\wx\wxprec.h

Environment variable WXWIN is set to C:\WXWIDGETS\3.2.0

What needs to be different?

Developer technologies C++
{count} votes

20 answers

Sort by: Most helpful
  1. RLWA32 49,536 Reputation points
    2022-07-18T01:25:12.337+00:00

    I don't think that you have followed the instructions from the wxwidgets site. After installing wxwidgets the guidance given is that you add the wxwidgets.props property sheet to your project. This will automatically provide the proper configuration for your vs2019 project.

    I suggest you start with a clean slate by creating a new solution for the wxwidgets "Hello World" sample.

    Open your new solution and view the Property Manager pane. Right click on your project and select "Add existing property sheet...". In the dialog that opens navigate to C:\wxwidgets\3.2.0 and select wxwidgets.props.

    Expand the nodes in the property manager and this is what you should see --

    221569-wxwidgets.png

    At this point you should be able to build the sample code.


  2. Bryan Kelly 486 Reputation points
    2022-07-21T23:58:35.673+00:00

    I don't see an edit option so just to be certain.
    ...
    Now I see an edit option, and my post from a minute ago is not visible.

    With wxWidget solution wx_vc16 opened, I clicked: Build -> Batch Build
    It opened with all options selected.
    I clicked Clean, let it finish, then Rebuild All and took a break.
    After a while the Output panel declared no errors.
    Is this what you asked about?

    0 comments No comments

  3. RLWA32 49,536 Reputation points
    2022-07-22T10:44:59.187+00:00

    Sorry, but I had to post an image of my instructions for you because this site refused accept the entered text -

    223752-instructions.png

    0 comments No comments

  4. RLWA32 49,536 Reputation points
    2022-07-22T14:56:17.977+00:00

    Images associated with previous instructions -

    Step 2 Delete subfolders in lib

    223766-wxlibclean.png

    Step 3 wxWidgets solution build

    223825-wxdebugdll.png

    Step 6 Create Empty Project

    223807-wxempty.png

    Step 7 Add source file

    223834-wxsource.png

    Step 8 Change Linker property

    223826-wxsubsystem.png

    Step 9 Paste "Hello World" sample into source file

    223767-wxbefore.png

    Step 10 After adding the wxwidgets property sheet to project

    223808-wxafter.png

    Step 12 Environment variable for path to wxwidgets DLL folder

    223800-wxpaths.png

    Step 13 Runing "Hello world" wxwidgets sample

    223866-wxrunning.png

    0 comments No comments

  5. Bryan Kelly 486 Reputation points
    2022-07-22T15:50:23.78+00:00

    Wow. You put a lot of effort into your reply.
    I struggle with clinical depression and have been getting frustrated at my inability to get something working.

    And sometimes when clicking Post Your Answer, a new page opens stating that my request could not be performed. I will watch for that next time, screen capture, and post in the right forum.

    Just wanted to let you know I am working your reply and will post again soon.
    Thank you for your time and thank you for your patience.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.