我是个 C++ 新手。
我正在尝试使用 Net Beans 下的 Wx-Widgets 构建 Windows 应用程序。
到目前为止一切顺利。我已经安装了所有东西,配置,构建 wx-widgets 并将其附加到新项目 - 在这里有一个好人的帮助:Can't make wx-widget work with net-beans .
现在我尝试构建我的第一个应用程序:
#include <wx/string.h>
int main(int argc, char **argv)
{
wxPuts(wxT("A wxWidgets console application"));
}
这就是我得到的:
我不确定这是否可读,所以我粘贴了错误:
g++ `C:\WXWIN\wx-config --cxxflags` -c -g -I../../../WXWIN/include `C:\WXWIN\wx-config --cxxflags` -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
/bin/sh.exe: C:WXWINwx-config: command not found
/bin/sh.exe: C:WXWINwx-config: command not found
In file included from ../../../WXWIN/include/wx/defs.h:21:0,
from ../../../WXWIN/include/wx/string.h:25,
from main.cpp:1:
../../../WXWIN/include/wx/platform.h:196:22: fatal error: wx/setup.h: No such file or directory
compilation terminated.
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/c/xampp/htdocs/WxWwigets_tutorial'
make[1]: Leaving directory `/c/xampp/htdocs/WxWwigets_tutorial'
BUILD FAILED (exit value 2, total time: 859ms)
请注意,我已经按照命令在链接器和编译器中设置了所有内容:http://wiki.wxwidgets.org/Compiling_using_Netbeans
最佳答案
错误就在您面前:“找不到命令”。如果你使用 /bin/sh
,你必须使用 Unix 风格的路径,例如C:/WXWIN/wx-config
而不是带有反斜杠的 DOS 路径。
我郑重地建议您熟悉您所使用的环境,而不是只按照 Wiki 说明进行操作而不理解它们,否则您的问题不会很快结束。
关于c++ - 无法在 Netbeans 中使用 WxWIdgets 构建测试应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16590468/