wxWidgets和NetBeans:无法识别" include"

时间:2014-06-18 13:47:34

标签: c++ netbeans wxwidgets

虽然找到<wx/cmdline.h>,但NetBeans会在<wx/wxprec.h><wx/socket.h>

中抱怨错误

error

构建

g++ `wx-config --cxxflags`     -o dist/Debug/GNU-Linux-x86/client build/Debug/GNU-Linux-x86/main.o -lpthread `wx-config --cxxflags`

NetBeans中的项目属性

projectProperties1

projectProperties2

我需要包含这些文件来创建套接字,我尝试执行以下操作:

wxPrintf("Creating socket...\n");
wxSocketClient socketClient;
socketClient = new wxSocketBase(wxSOCKET_NONE);

wxPrintf("Addressing...\n");
wxIPV4address addr;
addr.Hostname("127.0.0.1");
addr.Service(3000);
if (!socketClient.IsOk())  {
    wxPrintf("Could not listen at the specified port !\n");
    return 1;
}

wxPrintf("Trying to make connection...\n");
if (socketClient.Connect(addr, false)) {
    wxPrintf("Success\n");
} else {
    wxPrintf("Error!\n");
    return 1;
}

我的项目只是控制台。我不需要GUI。

1 个答案:

答案 0 :(得分:2)

您的IDE似乎无法识别反引号扩展机制,因此您需要在终端中运行wx-config --cxxflags,然后将输出复制并粘贴到IDE中,而不是直接在那里使用它(并且可能会抱怨到NetBeans开发人员并希望他们在将来的版本中添加对这个非常有用的功能的支持。)

相关问题