Helloworld 错误,高手看看,搞了个一个下午了

这是wxWidgets论坛的中文版本。在这里,您可以用您的母语汉语讨论上面任一子论坛所涉及的所有关于wxWidgets的话题。欢迎大家参与到对有价值的帖子的中英互译工作中来!
Post Reply
creator.sg
Earned a small fee
Earned a small fee
Posts: 11
Joined: Mon Nov 02, 2009 2:05 am

Helloworld 错误,高手看看,搞了个一个下午了

Post by creator.sg » Mon Nov 02, 2009 6:56 am

我试着根据如下Link做了一个例子;
http://wiki.codeblocks.org/index.php?ti ... _fireworks

但是很多错误,编译能通过,但是链接错误。
但是我在Build opotions里面有设置我的搜索路径。
bin\TestwxMain.o||In function `ZNK12wxWindowBase10GetMinSizeEv':|
)]+0x47)||undefined reference to `_imp___Z10wxOnAssertPKwiPKcS0_S0_'|
bin\TestwxApp.o||In function `ZN12wxAppConsole16OnFatalExceptionEv':|
C:\Dev\wxWidgets2.8\include\wx\app.h:(.rdata$_ZTV9TestwxApp[vtable for TestwxApp]+0x90)||undefined reference to `wxAppConsole::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'|
C:\Dev\wxWidgets2.8\include\wx\app.h:(.rdata$_ZTV9TestwxApp[vtable for TestwxApp]+0x94)||undefined reference to `wxAppConsole::OnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*)'|
||=== Build finished: 3 errors, 0 warnings ===|

liuyug
Experienced Solver
Experienced Solver
Posts: 53
Joined: Wed Jul 09, 2008 4:32 am

Post by liuyug » Mon Nov 02, 2009 7:22 am

把编译命令贴出来

creator.sg
Earned a small fee
Earned a small fee
Posts: 11
Joined: Mon Nov 02, 2009 2:05 am

Post by creator.sg » Mon Nov 02, 2009 7:28 am

liuyug wrote:把编译命令贴出来
我是用的Code::Blocks IDE 工具;我自己没有写makefile.IDE 里面的一些设置我也设置了。Build options Lib 搜索路径我设置了;还是报错。
但是编译是通过的;

JenT
Earned some good credits
Earned some good credits
Posts: 114
Joined: Fri Oct 24, 2008 9:23 am

Re: Helloworld 错误,高手看看,搞了个一个下午

Post by JenT » Mon Nov 02, 2009 8:34 am

creator.sg wrote:我试着根据如下Link做了一个例子;
http://wiki.codeblocks.org/index.php?ti ... _fireworks

但是很多错误,编译能通过,但是链接错误。
但是我在Build opotions里面有设置我的搜索路径。
bin\TestwxMain.o||In function `ZNK12wxWindowBase10GetMinSizeEv':|
)]+0x47)||undefined reference to `_imp___Z10wxOnAssertPKwiPKcS0_S0_'|
bin\TestwxApp.o||In function `ZN12wxAppConsole16OnFatalExceptionEv':|
C:\Dev\wxWidgets2.8\include\wx\app.h:(.rdata$_ZTV9TestwxApp[vtable for TestwxApp]+0x90)||undefined reference to `wxAppConsole::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'|
C:\Dev\wxWidgets2.8\include\wx\app.h:(.rdata$_ZTV9TestwxApp[vtable for TestwxApp]+0x94)||undefined reference to `wxAppConsole::OnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*)'|
||=== Build finished: 3 errors, 0 warnings ===|

設定成 GUI application。
在project ->properties -> type set gui application.

creator.sg
Earned a small fee
Earned a small fee
Posts: 11
Joined: Mon Nov 02, 2009 2:05 am

Re: Helloworld 错误,高手看看,搞了个一个下午

Post by creator.sg » Mon Nov 02, 2009 9:01 am

JenT wrote: 設定成 GUI application。
在project ->properties -> type set gui application.
Thanks,
我的工程已经设置成“GUI applicatin"。但是还编译不出来。郁闷了。

BlueDream
Earned a small fee
Earned a small fee
Posts: 13
Joined: Tue May 19, 2009 4:07 am

Re: Helloworld 错误,高手看看,搞了个一个下午

Post by BlueDream » Mon Nov 02, 2009 12:24 pm

creator.sg wrote:我试着根据如下Link做了一个例子;
http://wiki.codeblocks.org/index.php?ti ... _fireworks

但是很多错误,编译能通过,但是链接错误。
但是我在Build opotions里面有设置我的搜索路径。
bin\TestwxMain.o||In function `ZNK12wxWindowBase10GetMinSizeEv':|
)]+0x47)||undefined reference to `_imp___Z10wxOnAssertPKwiPKcS0_S0_'|
bin\TestwxApp.o||In function `ZN12wxAppConsole16OnFatalExceptionEv':|
C:\Dev\wxWidgets2.8\include\wx\app.h:(.rdata$_ZTV9TestwxApp[vtable for TestwxApp]+0x90)||undefined reference to `wxAppConsole::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'|
C:\Dev\wxWidgets2.8\include\wx\app.h:(.rdata$_ZTV9TestwxApp[vtable for TestwxApp]+0x94)||undefined reference to `wxAppConsole::OnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*)'|
||=== Build finished: 3 errors, 0 warnings ===|
没有命令行不好说,但是看来是没有正确连接库。

samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 324
Joined: Mon Oct 06, 2008 12:55 pm

Post by samsam598 » Tue Nov 03, 2009 12:51 am

creator.sg wrote:
liuyug wrote:把编译命令贴出来
我是用的Code::Blocks IDE 工具;我自己没有写makefile.IDE 里面的一些设置我也设置了。Build options Lib 搜索路径我设置了;还是报错。
但是编译是通过的;
对照这里检查一下wx配置是否完全正确:
http://wiki.codeblocks.org/index.php?ti ... wsQuickRef
Regards,
Sam
-------------------------------------------------------------------
Windows xp
VS.Net 2003/MinGW 3.4.5 C::B character set: UTF-8
wxWidgets github 3.0 RC1 Unicode Static build,Unicode Shared build.

creator.sg
Earned a small fee
Earned a small fee
Posts: 11
Joined: Mon Nov 02, 2009 2:05 am

Post by creator.sg » Tue Nov 03, 2009 1:22 am

samsam598 wrote:
creator.sg wrote:
liuyug wrote:把编译命令贴出来
我是用的Code::Blocks IDE 工具;我自己没有写makefile.IDE 里面的一些设置我也设置了。Build options Lib 搜索路径我设置了;还是报错。
但是编译是通过的;
对照这里检查一下wx配置是否完全正确:
http://wiki.codeblocks.org/index.php?ti ... wsQuickRef
多谢各位,问题解决:
看到此贴的新手注意了,当你在build wxwidgets 用的参数要和开发新建的工程的参数要一致;
BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1
如果是release 就在工程向导里面选择release.这个原因是我没有仔细看官方文档。

liuyug
Experienced Solver
Experienced Solver
Posts: 53
Joined: Wed Jul 09, 2008 4:32 am

Post by liuyug » Tue Nov 03, 2009 3:01 am

如果用GCC 加 -v 参数,可显示编译命令

Post Reply