User forums > Using Code::Blocks

Building a standalone exe

(1/4) > >>

robl:
Hi

I'm new to codeblocks, and trying to build a standalone .exe - It's a wxwidgets project.

I followed the instruction here (http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef) to set up the wxwidgets projects - (I used the wxPack installation option which includes the static libraries and made sure I left the "Use __WXDEBUG__ and Debug wxWidgets lib" UNchecked when creating the project)

It all builds fine in codeblocks - i.e. build + run works fine but the executable in the bin/release folder doesn't run - it come up with an error: "The program can't start because wxmsw28u_gcc.dll is missing from your computer"

1) why is it needing a dll? I thought I was building a "realease" not a "dll release" - i.e. all dll should be compiled into the exe.  I can't see any obvious options for making sure it's a full release.  Where abouts are they?  (in VC++ express it's under the compilation options and change it from "multithreaded dll" to "multithreaded" - I can't see the equivalent in codeblocks)

2) the file does actually exist here: "c:\wxWidgets2.8\lib\gcc_dll\wxmsw28u_gcc.dll", I've set up the global "$(#wx)" variable to point to "c:\wxWidgets2.8" and directories "c:\Program Files\CodeBlocks\MinGW\bin\" and "c:\wxWidgets2.8" are in my "path" environment variables

Can anyone help me out please - I'm guessing it's very obvious but it's defeating me at the moment!

Cheers

Rob

p.s. Have just added c:\wxWidgets2.8\lib\gcc_dll\ to the path env. variable so now runs on this pc but will not run on other pc's not containing these libraries - how can I link the referenced libraries into the executable? - i.e. a NON-dll release

vectis99:
I had this exact problem recently. I got around it by starting a second project with the same source files but untick the "Use wxWidgets dlls", use the monolithic library. If you look at the size of of your .exe it'll be tiny (55kb in my case), but the .exe with the monolithic library build will be much bigger (2.5mb ) and runs independantly of C::B.

Incidently, I found Dependancy Walker very useful in probing this bug/feature.

I hope you fiind this useful.

Mark Scott Cousins

gd_on:
Hi,
you have certainly built a wxwidget dll, so a dynamic library. If you link your project with this library, the linker resolves the links it needs with that library. So this library is also needed at run time.
If you want a completely independent executable, you need to link with a wxwidgets static library. You can generate one by using SHARED=0 on your make -f makefile.gcc ... line when you build wxwidgets. Your new static libraries will be in something like c:\wxWidgets2.8\lib\gcc_lib.

gd_on

robl:
Cheers for that Mark, unfortunately I now get:

C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x562): undefined reference to `_Unwind_Resume'
C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x2016): undefined reference to `_Unwind_Resume'
C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x2162): undefined reference to `_Unwind_Resume'
C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x29cf): undefined reference to `_Unwind_Resume'
C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x2a5f): undefined reference to `_Unwind_Resume'
 

and a lot more  of them! Any ideas? - Maybe I need to build wxwidgets manually rather than from wxPack?

stahta01:

--- Quote from: robl on January 29, 2011, 02:36:58 pm ---Cheers for that Mark, unfortunately I now get:

C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x562): undefined reference to `_Unwind_Resume'
C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x2016): undefined reference to `_Unwind_Resume'
C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x2162): undefined reference to `_Unwind_Resume'
C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x29cf): undefined reference to `_Unwind_Resume'
C:\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_string.o):string.cpp:(.text+0x2a5f): undefined reference to `_Unwind_Resume'
 

and a lot more  of them! Any ideas? - Maybe I need to build wxwidgets manually rather than from wxPack?


--- End quote ---

wxWidgets must be built and used with Compilers Compatible with each other!
IIRC, The above message means you are mixing SJLJ and DW2 versions of MinGW GCC compilers.

Tim S.

Navigation

[0] Message Index

[#] Next page

Go to full version