在虚拟机(Ubuntu)中编译wxWidgets项目

在虚拟机(Ubuntu)中编译wxWidgets项目,ubuntu,virtual-machine,codeblocks,wxwidgets,Ubuntu,Virtual Machine,Codeblocks,Wxwidgets,这是一个奇怪的问题,因为我在虚拟机之外没有Ubuntu的问题。所以我在OSX上运行虚拟盒。我已经加载了Ubuntu16,安装并编译了wxWidgets。这些示例在虚拟框中编译良好,运行良好,因此我知道wxWidgets运行良好 我的Ubuntu虚拟机中运行着Code::Blocks,我正在用Code::Blocks构建一个非常简单(如果不是默认的话)的程序。我只是创建一个新项目,并使用给定的默认代码运行该项目。当我编译项目时,这些就是我得到的错误 ||=== Build: Debug in te

这是一个奇怪的问题,因为我在虚拟机之外没有Ubuntu的问题。所以我在OSX上运行虚拟盒。我已经加载了Ubuntu16,安装并编译了wxWidgets。这些示例在虚拟框中编译良好,运行良好,因此我知道wxWidgets运行良好

我的Ubuntu虚拟机中运行着Code::Blocks,我正在用Code::Blocks构建一个非常简单(如果不是默认的话)的程序。我只是创建一个新项目,并使用给定的默认代码运行该项目。当我编译项目时,这些就是我得到的错误

||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
/home/brdavid/Documents/test/testMain.h|23|error: expected class-name before ‘{’ token|
/home/brdavid/Documents/test/testMain.h|25|error: expected ‘)’ before ‘*’ token|
/home/brdavid/Documents/test/testMain.h|34|error: ‘wxStaticText’ does not name a type|
/home/brdavid/Documents/test/testMain.h|35|error: ‘wxButton’ does not name a type|
/home/brdavid/Documents/test/testMain.h|36|error: ‘wxStaticLine’ does not name a type|
/home/brdavid/Documents/test/testMain.h|37|error: ‘wxButton’ does not name a type|
/home/brdavid/Documents/test/testApp.cpp||In member function ‘virtual bool testApp::OnInit()’:|
/home/brdavid/Documents/test/testApp.cpp|26|error: no matching function for call to ‘testDialog::testDialog(long int, const wxString&)’|
/home/brdavid/Documents/test/testMain.h|22|note: candidate: testDialog::testDialog()|
/home/brdavid/Documents/test/testMain.h|22|note:   candidate expects 0 arguments, 2 provided|
/home/brdavid/Documents/test/testMain.h|22|note: candidate: testDialog::testDialog(const testDialog&)|
/home/brdavid/Documents/test/testMain.h|22|note:   candidate expects 1 argument, 2 provided|
/home/brdavid/Documents/test/testApp.cpp|28|error: ‘class testDialog’ has no member named ‘Show’|
||=== Build failed: 8 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
我想可能还没有设置全局变量,事实就是这样。因此,我将base、include和lib分别添加为/home/wxWidgets-3.0.2、/home/wxWidgets-3.0.2/include、/home/wxWidgets-3.0.2/lib

这并没有解决问题。我已经将wx config-cflags和wx config-libs放在了正确的位置来构建这个程序

但这并不能解决问题。我以前从未见过这种情况,我的第一个猜测是我的全局变量没有指向正确的位置。但这是正确的路径,除非我需要在前面添加一些内容

有什么想法吗

更新以包含所询问的信息


我使用wiki页面配置了库/配置-禁用共享-启用unicode-启用发布

-cflags: -I/usr/local/lib/wx/include/gtk3-unicode-static-3.0-I/usr/local/include/wx-3.0-D_文件_偏移量_位=64-D__WXGTK___线程

libs:
-4.a/usr/usr/local/lib/lib/usr/usr/usr/局部/lib/本地/lib/usr/usr/局部/本地/lib/本地/lib/lib/lib/lib/lib/lib/lib/usr/usr/usr/usr/局部/本地/本地/lib/a/a/usr/usr/usr/usr/局部/本地/本地/本地/本地/libr/局/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地/本地.a/usr/local/lib/libwx_baseu-3.0.a-lgthread-2.0-pthread-lX11-lXxf86vm-lSM-lgtk-3-lgdk-3-LPANGOCAROI-1.0-lpango-1.0-latk-1.0-lcairo-lcairo-lgdk-pixbuf-2.0-lgio-2.0-lgobject-2.0-lglib-2.0-lpng-lexpat-lwxregexu-3.0-lwxjpeg-3.0-lz-ldl-lm的输出是什么?也许您在某处安装了第二个wxWidgets,wx配置不清楚?我检查了这些输出。他们向我结账。我相信我也没有第二次安装。但是,在生成调试版本和发布版本时,调用构建目录是否重要?我创建了gtk build debug等目录。我怀疑这和它有什么关系,但我想现在我正在寻找任何东西。你在哪里有wx编译的库?在Linux中,通常不在home/wxWidgets-3.0.2中构建它们/lib@DaveK,您是如何配置库的?您可以复制并粘贴您使用的完整配置行吗?然后发布wx config-cxflags和wx config-libs的输出/配置-禁用共享-启用unicode-启用发布。