Creating wxWidgets Programs with Visual Studio 2017 – Part 1

This post has been updated and published on Computing on Plains.

Advertisements

17 thoughts on “Creating wxWidgets Programs with Visual Studio 2017 – Part 1

  1. Pingback: Creating wxWidgets Programs with Visual Studio 2017 – Part 2 | Using C++

  2. Pingback: Creating wxWidgets Programs with Visual Studio 2015 – Part 1 | Using C++

  3. Hello,

    i followed your tutorial and i got to the point where i get your example running. The problem is that visual studio cant find the dll’s in the directory i provided via $(WXWIN). I made a directory just as u did and put the include and lib folders in there after i compiled for DEBUG x64 with DLL usage and Unicode support. I followed your instructions about the user macro and the include and library directories. If i put the dlls in the root directory of the solution, it works fine. If i have them only in the designated lib/vc_x64_dll directory, i get a missing dll error. Do you have any idea where this can come from. I checked your tutorial at least 3 times now and ive been programming with java and eclipse for 15+ years so i know my way around in IDE’s., etc. but i cant find the problem here. Maybe you have an idea where this comes from.

    Thx alot 🙂

    Like

  4. nvm the comment, i got it to work by adding the dll directory to the environment under Project Properties->Debugging->Environment = PATH=D:\wxWidgets\lib\vc_x64_dll;%PATH%
    $(LocalDebuggerEnvironment).

    thx anyway for your help

    Like

  5. Jim O
    Many thanks for your excellent wiki. For the first time I’ve been able to build a wx project using VS(2017).
    Everything you describe it easily followed and correct and in Debug mode everything works fine. There was some build errors in Release mode though. Not your fault. I think there’s a bug in wxWidgets (first) setup.h (C:\wxWidgets-3.1.1-rc\include\msvc\wx\setup.h) To get the Release to build I had to hack it like this:
    Row 118:
    wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, u, /wx/setup.h) // Bug:Added u and changed to 6 fields
    Row 131:
    #define wxSUFFIX_STR “u” // Bug: Added u
    This solution works for me here using MSVC but is not at all a general fix. Comments?
    Best
    Håkan

    Like

    • Håkan.

      From looking at the changes you made, I assume you built a UNICODE version of the wxWidgets libraries. Again looking at the code around the changes you made, you get to those lines because wxSUFFIX is empty. Look at lines 22-40 of setup.h where wxSUFFIX is defined. wxSUFFIX is set to “u” if _UNICODE is defined. _UNICODE gets defined when you set the character set for your project to Unicode as stated in my post:

      “Change the Character Set setting to the appropriate value. Note that the default wxWidgets builds have the Use Unicode Character Set setting, so unless you modified this in your wxWidgets build, you should set this value.”

      That should fix your problem.
      Jim

      Like

      • Jim.
        Very good! It must have been as you describe although it was now set to Unicode. There must have been a temporary mistake for the release mode. And my “fix” worked, of course, for both character settings.
        We’ll all learn by time. Hopefully!
        Thanks for your lesson here and again for your excellent wiki.
        Håkan

        Liked by 1 person

  6. My error is: “1>c:\users\wilso\documents\wxwidgets\include\wx\wxcrt.h(496): note: consulte a referência à instanciação da função modelo ‘int wxStrcoll_String(const wxString &,const T &)’ que está sendo compilada”

    Like

    • Did you build the wxWidgets libraries for Unicode, and then attempt to build the program as Multibyte character set, or vice-versa?

      That seems like the most likely cause of your error, although I have not had a chance to look at the problem in detail. It will be 2 weeks or more before I can.

      Like

    • First, I would like to appreciate the owner of this website for teaching wxWidgets.

      to fix this error,
      Project -> Properties -> Configuration Properties -> C/C++ -> Command Line -> /permissive

      thank you

      Like

  7. Thank you for your tutorial.It helped me a lot but finally , after trying to build , I got these

    messages :

    Error C3861 ‘wxStrcoll’: identifier not found
    and :

    Error (active) E1256 __w64 can only be specified on int, long, and pointer types .

    Please , help me !

    Like

  8. Pingback: VS2017与wxWidgets的开发环境配置(仅静态链接) | 沉默的猫

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s