c++ - wxWidgets - 缺少 wx/setup.h

标签 c++ wxwidgets fedora

您好,使用“yum install wxGTK-devel”安装了 wxWidgets(我使用的是 fedora 20)。 我正在尝试编译以下示例文件:

测试.cpp:

#include <wx/wx.h>

int main(void)
{
    return 0;
}

使用这一行:

g++ -I/usr/include/wx-2.8 pru.cpp

但我知道 wx/setup.h 不存在。我四处寻找,但没有找到。

问题是在wx/platform.h中有如下一句:

#include "wx/setup.h"

我不知道这应该如何工作或如何让它工作。 如果您知道如何解决这个问题或至少有提示,我将不胜感激。

最佳答案

wxWidgets documentation 开始关注:

Linking and Compiling

Normally when you include wxWidgets you say "wx/wx.h" however wxwidgets is in the subdirectory of wx-2.8/wx so what we are going to do is create a link to wx-2.8/wx.

sudo ln -sv wx-2.8/wx wx

That's all, now your files should compile correctly.

When you compile your files to include the wxWidgets libraries, add this to the end of your gcc command:

`wx-config --cxxflags` `wx-config --libs`

例如:

g++ your_code.cpp `wx-config --cxxflags` `wx-config --libs`

关于c++ - wxWidgets - 缺少 wx/setup.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30462649/

相关文章:

php - MySql 更新后找不到 mysql.infoschema

C++ ffmpeg x264编码设置

c++ - 通过 C++ UWP 应用程序与 Azure 应用程序服务集成

c++ - wxWidgets 大量 undefined reference

wxPython:wx.Panel 和 wx.Window 有什么区别?

google-chrome - 找不到 sslauncher :///? ssurl=url Chrome Fedora SSLauncher 的任何应用程序或处理程序

php - 在 Fedora 上为 PDO-MySQL 设置 SSL

c++ - boost lambda : Invoke method on object

c++ - 如何在 Visual Studio 2019 预览版中启用 C++ 模块支持

python - wxPython的基础