ID返回1个退出状态-带wxWidgets的CodeBlocks [英] Id returned 1 exit status - CodeBlocks with wxWidgets

查看:366
本文介绍了ID返回1个退出状态-带wxWidgets的CodeBlocks的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为Code :: Blocks安装了wxWidgets,并观看了YouTube上有关如何执行此操作的教程,一切似乎都很好。我创建了一个新项目,但无法编译。我得到一个错误。这是我创建项目时的样子,并且不对其进行任何更改。



创建项目时,项目





这是错误。


ld.exe找不到-lwxmsw28u


解决方案

1)为了使其正常运行,您需要转到设置- ->全局变量。我的wxWidgets的主目录是 C:\wxWidgets-3.1.0-tdmgcc32 ,它是用 gcc 编译的。



基础: C:\wxWidgets-3.1.0-tdmgcc32



include: C:\wxWidgets-3.1.0-tdmgcc32\include(基本上是include dir在哪里)



lib: C:\wxWidgets-3.1.0-tdmgcc32\lib\gcc_dll(所有库文件(dll,.a或.lib所在的位置))



2)新建项目-> wxWidgets项目。在这里,请确保如果您将wxWidgets编译为单片,请选择 wxWidgets是作为单片库构建的



3)转到项目->构建选项...



将以下设置应用于发布 >。对于Debug, mswu 应该为 mswud 。如果使用Visual Studio编译了wxWidgets,则应该看到 lib / vc_dll lib / gcc_dll >

如果您按照以下步骤操作并正确应用它们,则应该可以使用。





注意:



1)如果您尚未将wxWidgets编译为单片,则可以使用lib gcc_dll目录下的 libwxmsw31u.a ,您可能会看到不同的名称,现在就包括它们,以后可以选择。



2) libwxmsw31u.a 用于发行版, libwxmsw31ud.a 用于调试版。确保在调试和发布版本中包含正确的文件。


I have installed wxWidgets for Code::Blocks, watched a tutorial on YouTube on how to do this, everything seemed fine. I created a new project, but I can't compile. I get an error. This is how a project looks when I create it, and I do not change nothing in it.

Project when I created it

And here is the error.

ld.exe cannot find -lwxmsw28u

解决方案

1) In order to make it work, you need to go to settings-->Global Variables. My home directory for wxWidgets is C:\wxWidgets-3.1.0-tdmgcc32 and this is compiled with gcc.

Base: C:\wxWidgets-3.1.0-tdmgcc32

include: C:\wxWidgets-3.1.0-tdmgcc32\include (basically where include dir is)

lib: C:\wxWidgets-3.1.0-tdmgcc32\lib\gcc_dll (where all your library files (dll,.a or .lib) are located)

2) New Project-->wxWidgets project. Here make sure that if you have compiled wxWidgets as monolithic, select wxWidgets is built as monolithic library

3) go to Project-->Build Options...

Apply the following settings to Release. For Debug, mswu should be mswud. If you compiled wxWidgets with Visual Studio, then instead of lib/gcc_dll, you should see lib/vc_dll

If you follow the steps and apply them correctly, it should work.

Notes:

1) if you have not compiled wxWidgets as monolithic, then instead of libwxmsw31u.a under lib gcc_dll directory, you might see different names, just include them for now, later on you can be selective.

2) libwxmsw31u.a is for the release version and libwxmsw31ud.a is for Debug version. Make sure, you include correct files in the debug and release versions.

这篇关于ID返回1个退出状态-带wxWidgets的CodeBlocks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆