installing wxWidgets in Visual Studio
installing wxWidgets in Visual Studio
I have Visual Studio Community 2019
I downloaded the wxWidgets 3.1.2 source, and unzipped it to C:\wxWidgets-3.1.2
I found wx_vc15.sin in wxwidgets root/build/msw and used it to compile the source
I started a project with the Hello World program in the docs.
It couldn't find wx.h, so I added three includes:
c:\wxwidgets-3.1.2\include\;
c:\wxwidgets-3.1.2\include\wx;
c:\wxWidgets-3.1.2\include\msvc;
As I added each one it found more of the includes it needed
Now I'm stuck. It can't open setup.h
Severity Code Description Project File Line Suppression State
Error (active) E1696 cannot open source file "../../../lib/vc_lib/mswd/wx/setup.h" mapping C:\wxWidgets-3.1.2\include\msvc\wx\setup.h 125
I downloaded the wxWidgets 3.1.2 source, and unzipped it to C:\wxWidgets-3.1.2
I found wx_vc15.sin in wxwidgets root/build/msw and used it to compile the source
I started a project with the Hello World program in the docs.
It couldn't find wx.h, so I added three includes:
c:\wxwidgets-3.1.2\include\;
c:\wxwidgets-3.1.2\include\wx;
c:\wxWidgets-3.1.2\include\msvc;
As I added each one it found more of the includes it needed
Now I'm stuck. It can't open setup.h
Severity Code Description Project File Line Suppression State
Error (active) E1696 cannot open source file "../../../lib/vc_lib/mswd/wx/setup.h" mapping C:\wxWidgets-3.1.2\include\msvc\wx\setup.h 125
Re: installing wxWidgets in Visual Studio
start with the "minimal" sample in <wxdir>/samples/minimal/I started a project with the Hello World program in the docs.
It should build out of the box.
Use the source, Luke!
Re: installing wxWidgets in Visual Studio
Additionally, one is supposed to (at least) read the install guide
https://github.com/wxWidgets/wxWidgets/ ... install.md
Using wxWidgets with MSVC can be actually quite simpler than with other compilers, see the docs.
https://github.com/wxWidgets/wxWidgets/ ... install.md
Using wxWidgets with MSVC can be actually quite simpler than with other compilers, see the docs.
Re: installing wxWidgets in Visual Studio
Nope. It's .sin file wouldn't load. I loaded the project file and it was for an old version of VS, VS "updated" it, and it couldn't find includes, etc.
Re: installing wxWidgets in Visual Studio
I started with minimal again. This time I started with an empty project, added the minimal.cpp program, added the same 3 includes I did before.
It got about as far as the Hello World program.
Cannot open source file ..\sample.xpm
Cannot open source file ..\..\..\lib\vc_lib\mswd\wx\setup.h
I don't see a sample.xpm anywhere;
setup.h is in C:\wxWidgets-3.1.2\include\msvc\wx
Do I need to add a library directory that points to setup.h?
It seems to be looking for a library named setup.h
It got about as far as the Hello World program.
Cannot open source file ..\sample.xpm
Cannot open source file ..\..\..\lib\vc_lib\mswd\wx\setup.h
I don't see a sample.xpm anywhere;
setup.h is in C:\wxWidgets-3.1.2\include\msvc\wx
Do I need to add a library directory that points to setup.h?
It seems to be looking for a library named setup.h
Re: installing wxWidgets in Visual Studio
Don't. There are too many things to set up including several preprocessor symbols. It's a pain in the *** to create a wxWidgets project from scratch.I started with minimal again. This time I started with an empty project, added the minimal.cpp program, added the same 3 includes I did before.
It got about as far as the Hello World program.
If you were able to build wxWidgets itself with the solution files, the minimal sample should work, too.
Can you try with the latest version from GIT? https://github.com/wxWidgets/wxWidgets
Use the source, Luke!
Re: installing wxWidgets in Visual Studio
Can't make any sense of the GIT website.
I think I'll start over. Dump Visual Studio 2019 since it's new, and go back to a version that has wx binaries.
I think I'll start over. Dump Visual Studio 2019 since it's new, and go back to a version that has wx binaries.
Re: installing wxWidgets in Visual Studio
I haven't tried VS2019 yet, but i know that with VS2017 wxWidgets and its samples build out of the box.
Use the source, Luke!
Re: installing wxWidgets in Visual Studio
VS 2017 looks as hard to install as 2019, so I'm sticking with 2019. Right now setup.h seems to be the problem. There's a "fake" one it starts with, in include\msvc\wx, which then calls the "real" one, which I think is in include\wx\msw, but the "fake" one is looking in the lib directory.
It's looking for ..\..\..\lib\etcetcetc. Can't imagine what directory it's starting in, to go up 3 to get to the lib directory. Seems like the "fake" one is garbage, maybe.
I'm going to keep looking for a while, but I have a feeling this is going nowhere.
I guess what I really need is just an existing project that actually works in VS 2019, and then I can just gut the program and use it as my starter.
Should I post a request to that effect in one of the forums? Or just look in the docs or something like that? Thanks for all your replies. I still can't get over how difficult this has turned out to be!
It's looking for ..\..\..\lib\etcetcetc. Can't imagine what directory it's starting in, to go up 3 to get to the lib directory. Seems like the "fake" one is garbage, maybe.
I'm going to keep looking for a while, but I have a feeling this is going nowhere.
I guess what I really need is just an existing project that actually works in VS 2019, and then I can just gut the program and use it as my starter.
Should I post a request to that effect in one of the forums? Or just look in the docs or something like that? Thanks for all your replies. I still can't get over how difficult this has turned out to be!
Re: installing wxWidgets in Visual Studio
It would be better if you can say does minimal sample works for you? If it works you can just create VS-template base on it or create a new one by copying settings. If not - something went wrong and you should fix that issue first.
Re: installing wxWidgets in Visual Studio
Did you use one of the Windows archives? The Unix one has different line endings which Visual Studio doesn't like.downloaded the wxWidgets 3.1.2 source
Use the source, Luke!
Re: installing wxWidgets in Visual Studio
I forgot there were all those working programs in samples, so I tried minimal and it worked. I just can't make a copy and put it in a different directory; all of it's directory paths are relative to it being in the samples directory, so I'm in the process of hardcoding them to my C:\wxWidgets directory. So far so good! Current problem is the project properties have a dozen includes starting with ..\..\, the same relative path that I'm fixing in the solution and project files. I'm hoping a "minimal" program doesn't actually use a dozen different include directories!
About the Unix format - I did have an error somewhere along the line where it said the file didn't have the normal CR/LF line endings, but I think it was just one file. Hopefully 99% of mine are correct.
Onward! Need to fix the include dir properties.
About the Unix format - I did have an error somewhere along the line where it said the file didn't have the normal CR/LF line endings, but I think it was just one file. Hopefully 99% of mine are correct.
Onward! Need to fix the include dir properties.
Re: installing wxWidgets in Visual Studio
Per configuration you'll need two include paths, one library path and one for resources.
And try to avoid hardcoded, absolute paths. Define an environment variable that points to your wxWidgets directory. E.g. If you name it "WXW31", you can use this as include path:
$(WXW31)\include
And try to avoid hardcoded, absolute paths. Define an environment variable that points to your wxWidgets directory. E.g. If you name it "WXW31", you can use this as include path:
$(WXW31)\include
Use the source, Luke!
Re: installing wxWidgets in Visual Studio
OK, how do I define an environment variable?
include\wx\platform.h has this line: include "wx/setup.h" and can't find it.
None of these things have worked:
setup.h is in include\msvc\wx, which I added to the project properties
I have put setup.h in include\wx
I have put setup.h in include\wx\wx
My project properties:
include
include\wx
include\msvc\wx
Even if trying to include setup.h is wrong, why hasn't one of these things worked?
include\wx\platform.h has this line: include "wx/setup.h" and can't find it.
None of these things have worked:
setup.h is in include\msvc\wx, which I added to the project properties
I have put setup.h in include\wx
I have put setup.h in include\wx\wx
My project properties:
include
include\wx
include\msvc\wx
Even if trying to include setup.h is wrong, why hasn't one of these things worked?
Re: installing wxWidgets in Visual Studio
https://www.techjunkie.com/environment- ... indows-10/
There should be two entries for include path. The first one is configuration specific. This must match the configuration you used when building wxWidgets itself. E.g. for Unicode, Debug, Static, it looks like this:
$(WXW31)\lib\vc_lib\mswud
This one must also be the first in the list
The second one is universal:
$(WXW31)\include
I thought you already had a working base?I forgot there were all those working programs in samples, so I tried minimal and it worked.
*Never* move files around to fix errors like this.I have put setup.h in include\wx
I have put setup.h in include\wx\wx
There should be two entries for include path. The first one is configuration specific. This must match the configuration you used when building wxWidgets itself. E.g. for Unicode, Debug, Static, it looks like this:
$(WXW31)\lib\vc_lib\mswud
This one must also be the first in the list
The second one is universal:
$(WXW31)\include
Use the source, Luke!