DEV Community

undeadindustries
undeadindustries

Posted on

VSCode and WxWidgets

I can't seem to get VS Code to like WxWidgets on Linux or MacOS. It seems like it's trying to default to MSW?

The specific question is making VSCode play nice (autocomplete, don't give false errors) with WxWidgets. In command prompt, compiling any Wx project works perfect.

Steps:

  1. VS Code is installed
  2. Create folder for project. Let's call it /src/hello
  3. Create a hello.cpp file with code from: https://docs.wxwidgets.org/3.0/overview_helloworld.html
  4. Download WxWidgets into /src/hello/deps
  5. Going through steps to compile and install Wx https://docs.wxwidgets.org/trunk/plat_osx_install.html
  6. Check my Intellisense includes to include ${workspaceFolder}/**

Now, in the command prompt, if I run:
g++ hello.cpp 'wx-config --cxxflags --libs' -o hello
./hello runs perfect!

But in VSCode is unusable because it's giving me this error:
cannot open source file "../../../lib/vc_lib/msw/wx/setup.h" (dependency of "wx/wxprec.h")

I'm pretty sure msw is for windows?

I feel like I've tried everything:

  1. Downloaded and Git version of Wx (Yeah, I know it's the same. But people on the wx forums recommended trying...)
  2. Use the Homebrew WxWidgets install.
  3. Using the sample projects included with Wx.
  4. Using the Hello World
  5. Same issues in Linux and MacOS.
  6. Updating Intellisense's includes every way you can think of.
  7. Using the output of wxconfig and putting the cxxflags and lib include output into Intellisense.

Anyone able to test this all on their MacOS or Linux system and see if they are able to get VS Code to play nice?

THANK YOU!!

Top comments (4)

Collapse
 
polterguy profile image
Thomas Hansen

wxWidgets? Talk about blast from the past. That thing still alive ...? 😊

Collapse
 
undeadindustries profile image
undeadindustries

Yeah. It's updated regularly.

I'd rather use it over QT because of how specific QT is about the OS license, linked libs, etc.

I was going to use Flutter, but it doesn't have a proper datatable feature. (And I don't know it well enough to force Jquery Datatable to work)

Not using electron because I'm a stubborn old man. lol.

Collapse
 
polterguy profile image
Thomas Hansen

Interestingly, I remember it 20 years ago when it was created :)

Thread Thread
 
undeadindustries profile image
undeadindustries

Same.