Code::Blocks Forums
User forums => Help => Topic started by: SedesGobhani on August 18, 2009, 12:51:39 am
-
Hi;
I installed wxWindows and compiled using Borland. I got the error about -lwxmsw_core. I searched the forum for that term and found only one thread, which seemed unresolved. I then googled and found someone showing how to select build options from the Wizard. When I use the wizard to create new WxWidgets project I don't get prompted about build options (ie. shared, monolithic, unicode...). So I read that if you install wxPack you don't have to worry about build options, it just works. So I installed that and changed the global variable wx base to the default place where wxPack installed, which is C:\SourceCode\Libraries\wxWidgets2.8. However I still get the -lwxmsw_core error. The error appears as below:
-------------- Build: Release in fx2gui ---------------
Linking executable: bin\Release\fx2gui.exe
C:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot find -lwxmsw_core
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 4 seconds)
1 errors, 0 warnings
I've been using Code::Blocks for writing console apps and DLLs but on this problem now I've spent enough time dinking around with it I figured it's time to humble myself and ask for some help.
Thanks,
SG
-
Try the wiki (http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef)...
-
Try the wiki (http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef)...
Yep. Solved that, and a few other problems since then. Now I'm stuck with:
undefined reference to `__Unwind_Resume'
I give up.
Thanks partners. Always a pleasure.
-
Shot in the dark, is your file extension correct?
.c for c code
.cpp for c++ code
Tim S.
-
undefined reference to `__Unwind_Resume'
Did you use the very same compiler that wxPack was compiled with?
For example: if wxPack was compiled with GCC4 you cannot do your stuff with GCC3.x.
-
Shot in the dark, is your file extension correct?
.c for c code
.cpp for c++ code
Tim S.
I am actually not using any of my own stuff yet. This is just files from the Code::Blocks wizard for the starter wx dialog app. They were probably pretested and I doubt the problem could be there.
Regarding the compiler that wxPack was compiled with, I'm not sure how I would know. There are libraries precompiled in something. There are lots of makefiles for different compilers in the pack.
A little research seemed to indicate it may have something to do with something called an "unwinder" which is not in the main lib but in some secondary lib, but I don't know what lib that would be. Bottom line seems to be since I don't know how wxPack was compiled, and I don't know what I was doing the first time I compiled wxWidgets, I'm going to have to bite the bullet and recompile it (like 3 hours d'oh!).
I have been looking for documentation on mingw compiler/linker options but haven't been able to locate in the MinGWiki pages. That's probably a big source of my problem. Anyone have a pointer to that? I see lots of examples with different options being used but I can't find them all in one place with documentation. I bet some make-file genius knows.
Thx,
SG
-
Shot in the dark, is your file extension correct?
.c for c code
.cpp for c++ code
Tim S.
I am actually not using any of my own stuff yet. This is just files from the Code::Blocks wizard for the starter wx dialog app. They were probably pretested and I doubt the problem could be there.
Regarding the compiler that wxPack was compiled with, I'm not sure how I would know. There are libraries precompiled in something. There are lots of makefiles for different compilers in the pack.
A little research seemed to indicate it may have something to do with something called an "unwinder" which is not in the main lib but in some secondary lib, but I don't know what lib that would be. Bottom line seems to be since I don't know how wxPack was compiled, and I don't know what I was doing the first time I compiled wxWidgets, I'm going to have to bite the bullet and recompile it (like 3 hours d'oh!).
I have been looking for documentation on mingw compiler/linker options but haven't been able to locate in the MinGWiki pages. That's probably a big source of my problem. Anyone have a pointer to that? I see lots of examples with different options being used but I can't find them all in one place with documentation. I bet some make-file genius knows.
Thx,
SG
Well I had a few moments of joy as I did a clean workspace, added -mingw32-g++ to linker options, and rebuild workspace, and it actually compiled and linked. But when I ran it I got App error message: "The application failed to initialize properly (0xc0000005). Click on OK to terminate the application." The build messages also looked a bit odd:
...
Compiling: resource.rc
Compiling: fx2gui3App.cpp
Linking executable: bin\Release\fx2gui3.exe
Info: resolving wxDialogBase::sm_eventTable by linking to __imp___ZN12wxDialogBase13sm_eventTableE (auto-import)
Info: resolving _wxEmptyString by linking to __imp__wxEmptyString (auto-import)
Info: resolving _wxDefaultSize by linking to __imp__wxDefaultSize (auto-import)
Info: resolving wxStringBase::npos by linking to __imp___ZN12wxStringBase4nposE (auto-import)
&c...
C:\Program Files\CodeBlocks\MinGW\bin\ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
Output size is 82.00 KB
&c...
-
"The application failed to initialize properly (0xc0000005). Click on OK to terminate the application." is spitted by the visual studio/C runtime library (most likely).
I've seen that message when some of the libs/dlls are compiled with vc2005/vc2008 but the correct runtime is not installed/found.
Keep in mind that vc2005 runtime is different from vc2005sp1 runtime and from any other hot fixed runtime (there was a hotfix to the runtime :( ).
-
I went back to my first wxWidgets build, and reran the wizard, telling it to use the DLL, and it worked!!! Compiled and linked and ran!
But now I have to drag this big DLL file along with my program, when I wanted the program to be stand alone, so I still need to recompile static. Crossing fingers!!!
Thanks folks for being patient with me through all this traumatic experience. :mrgreen:
-
And it works!
(Now I feel stupid for all them bad things I thought about C::B).
SG