wxwidgets setup.h“没有这样的文件”
对这个问题的快速谷歌搜索表明它很常见,我只是无法在我的案例中找出解决方案。
我直接从 wxWidgets 网站直接安装了适用于 Windows 的 wxWidgets 2.8.8。
每当我尝试编译任何内容(例如“wxWidgets 的第一个程序”中描述的示例应用程序 - http:// /zetcode.com/tutorials/wxwidgetstutorial/firstprograms/ )我得到:
wx/setup.h:没有这样的文件或目录,
我已包含 C:\wxWidgets-2.8.8\include 和 C:\wxWidgets -2.8.8\include\wx 在我的编译器搜索列表中。
它应该很简单 - 但事实并非如此! :(
如果我尝试使用与 wxWidgets 集成的 IDE(例如 Code::Blocks),也会发生同样的事情 - 而且我本以为这会解决这个问题...
所以,请提供一些帮助..为什么找不到setup.h?
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.8\include and C:\wxWidgets-2.8.8\include\wx 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
当您“安装”wxMSW 安装程序时,wxWidgets 并未内置到可用库中。 这是因为有很多可配置元素,这正是您引用的 setup.h 的用途。
如果您只想尽快使用默认选项构建它并继续,请按以下步骤操作:
启动“Visual Studio 命令提示符”。 您可以在开始菜单的“Microsoft Visual Studio -> Visual Studio Tools”下找到它。
更改为文件夹:[WXWIN root]\build\msw
构建默认调试配置:
nmake -f makefile.vc BUILD= debug
构建默认发布配置:
nmake -f makefile.vc BUILD=release
确保 DLL 位于您的 PATH 中。 它们可以在 [WXWIN root]\lib\vc_dll
中找到。
在上面提到的 DLL 文件夹下,您将找到每个构建变体的子文件夹(上面的说明做了两个,调试和发布。)在每个变体文件夹中,您'将找到一个包含“setup.h”文件的“wx”文件夹。您会发现每个构建变体的 setup.h 文件实际上都是不同的。这些是您需要添加到项目构建配置包含路径中的文件夹,因此,例如,您可以将 [WXWIN root]\lib\vc_dll\mswud 添加到调试版本的包含路径中,将 [WXWIN root]\lib\vc_dll\mswu 添加到发布版本的包含路径中。 p>
可以构建许多其他变体组合:静态库、整体单个库、非 Unicode 等。有关更广泛的说明,请参阅 [WXWIN root]\docs\msw\install.txt。
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:
Start the "Visual Studio Command Prompt." You'll find this in the start menu under "Microsoft Visual Studio -> Visual Studio Tools".
Change to folder: [WXWIN root]\build\msw
Build default debug configuration:
nmake -f makefile.vc BUILD=debug
Build default release configuration:
nmake -f makefile.vc BUILD=release
Make sure the DLLs are in your PATH. They'll be found in [WXWIN root]\lib\vc_dll
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]\lib\vc_dll\mswud to the include path for your debug build, [WXWIN root]\lib\vc_dll\mswu for your release build.
It is possible to build lots of other variant combinations: static libs, monolithic single library, non-Unicode, etc. See [WXWIN root]\docs\msw\install.txt for much more extensive instructions.
当构建 wxWidgets 时,它会为构建的每个构建配置动态创建一个 setup.h 文件。 生成的 setup.h 文件存储在 lib 文件夹下的文件夹中,例如(Windows 上的 Visual Studio):
要成功构建基于 wxWidgets 的项目,项目中的每个构建配置都必须设置其自己的附加包含目录指向lib下对应的wxWidgets构建文件夹,如上面列出的那个。
此外,项目中所有构建配置共用的附加包含目录必须设置为指向 wxWidget 的主包含文件夹。 该文件夹通常设置在可在任何项目中使用的用户属性表中。 例如:
为了链接,所有构建配置通用的附加库目录被设置为指向 wxWidgets lib 文件夹。 例如:
然后,针对每个构建配置,设置附加依赖项以包含相应 wxWidgets 库的库。 例如,对于 Unicode,调试构建(u = Unicode,d = 调试):
然后,要在项目中使用 wxWidgets,首先包含生成的 setup.h 文件:
然后包含特定 wxWidgets 功能的标头。 例如:
When building wxWidgets, it dynamically creates a setup.h file for each build configuration that is built. The generated setup.h files are stored in folders below the lib folder, for instance (Visual Studio on Windows):
To successfully build a project based on wxWidgets, each build configuration in the project must be set up with its own Additional Include Directory that points to the corresponding wxWidgets build folder under lib, such as the one listed above.
In addition, an Additional Include Directory that is common for all build configurations in the project must be set to point to wxWidget's main include folder. This folder is typically set up in a user property sheet that can be used in any project. E.g.:
For linking, an Additional Library Directory common for all build configurations is set up to point to the wxWidgets lib folder. E.g.:
And then, specific to each build configuration, Additional Dependency entries are set up to include libraries of the corresponding wxWidgets libraries. E.g., for a Unicode, Debug build (u = Unicode, d = Debug):
Then, to use wxWidgets in your project, start out by including the generated setup.h file:
And then include headers for specific wxWidgets functionality. E.g.:
您可能需要构建 wxWidgets。 wxWidgets 构建过程中有一个构建后步骤,将相应的 setup.h 复制到 C:\wxWidgets_install_dir\include\wx 中。
You probably need to build wxWidgets. There is a post-build step in the wxWidgets build process that copies the appropriate setup.h into C:\wxWidgets_install_dir\include\wx.
是的,即使我在 Windows 上也遇到过这个问题。 但这是最简单的事情。 (复制和粘贴)
您必须将 setup.h 文件从
./wxWidgets/include/wx/msw/wx/setup.h
复制到。 /wxWidgets/include/wx
目录。因此,您的源代码可以将该文件用作
#include
此 setup.h 在内部包含所有 wxwidgets UI 控件。
Yeah, Even I have faced this issues on Windows. But it was simplest thing to do. (Copy & Paste)
You have to copy that setup.h file from
./wxWidgets/include/wx/msw/wx/setup.h
to./wxWidgets/include/wx
directory.So your source code can use that file as
#include <wx/setup.h>
This setup.h include all wxwidgets UI control internally.
为了使任何工作正常进行,您首先必须构建核心库(wx_vc#.sln 文件)。
然后你就可以处理剩下的东西了。
请记住,您需要 CppUnit 来编译测试用例。
For anything to work, you first have to build the core libraries (wx_vc#.sln files).
Then you can work with the remainder stuff.
Remember you need CppUnit for testcases to compile.