Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
495 views
in Technique[技术] by (71.8m points)

compiler construction - wxwidgets setup.h "no such file"

A quick Google search of this issue shows it's common, I just can't for the life of me figure out the solution in my case.

I have a straight forward install of wxWidgets 2.8.8 for Windows straight from the wxWidgets website.

Whenever I try to compile anything (such as the sample app described in "First Programs for wxWidgets" - http://zetcode.com/tutorials/wxwidgetstutorial/firstprograms/ ) I get:

wx/setup.h: No such file or directory

I've included both C:wxWidgets-2.8.8include and C:wxWidgets-2.8.8includewx in my compiler search list.

It should be simple - but it's not! :(

The same thing happens if I try to use an IDE integrated with wxWidgets (such as Code::Blocks) - and this, I would have thought, would have just worked out the box...

So, some help please... Why is setup.h not found?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

wxWidgets is not built into useable libraries when you "install" the wxMSW installer. This is because there are so many configurable elements, which is precisely what the setup.h you refer to is for.

If you just want to build it with default options as quickly as possible and move on, here is how:

  1. Start the "Visual Studio Command Prompt." You'll find this in the start menu under "Microsoft Visual Studio -> Visual Studio Tools".

  2. Change to folder: [WXWIN root]uildmsw

  3. Build default debug configuration: nmake -f makefile.vc BUILD=debug

  4. Build default release configuration: nmake -f makefile.vc BUILD=release

  5. Make sure the DLLs are in your PATH. They'll be found in [WXWIN root]libvc_dll

  6. Under the DLL folder mentioned above, you will find subfolders for each build variant (The instructions above made two, debug and release.) In each variant folder you'll find a 'wx' folder containing a 'setup.h" file. You'll see that the setup.h files are actually different for each build variant. These are the folders you need to add to your project build configuration include path, one per build variant. So, for example, you'd add [WXWIN root]libvc_dllmswud to the include path for your debug build, [WXWIN root]libvc_dllmswu for your release build.

  7. It is possible to build lots of other variant combinations: static libs, monolithic single library, non-Unicode, etc. See [WXWIN root]docsmswinstall.txt for much more extensive instructions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...