Id returned 1 exit status - CodeBlocks with wxWidgets

*爱你&永不变心* 提交于 2019-12-13 10:29:20

问题


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:


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.



来源:https://stackoverflow.com/questions/42157686/id-returned-1-exit-status-codeblocks-with-wxwidgets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!