User forums > Using Code::Blocks
Building a standalone exe
easyw:
Hi there
I'm trying to compile a standalone exe ...
I've installed:
- CB 10.05 + Mingw
- wxPack_v2.8.9.02
and I tried to start a prj from template, using wxSmith, but the best I can obtain requires at least mingwm10.dll ...
could someone help me, may be sending a sample cb porject?
thanx :)
easyw:
I found a way for windows ... I post it here ...
1] download and install CB & MingW [codeblocks-10.05mingw-setup.exe]
NB to easily compile WxWidgets I installed CB in "C:\CodeBlocks" instead of c:\Program Files
2] download and install wxMSW [wxMSW-2.8.12-Setup.exe] from http://www.wxwidgets.org/downloads/
NB to easily compile WxWidgets I installed wxMSW in C:\wxWidgets-2.8.12
3] move to "C:\wxWidgets-2.8.12\build\msw" and create a batch file as following (monolithic lib no dll for release)
path C:\CodeBlocks\MinGW\bin
C:\CodeBlocks\MinGW\bin\mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 RUNTIME_LIBS=static SHARED=0
4] launch the batch file and wait until the libs are built [C:\wxWidgets-2.8.12\lib\gcc_lib]
(if you need also debug build just rebuild with "BUILD=debug" option)
5] then launch CB and 'create a new project' wizard with wxWidgets
- select wxWidgets 2.8.x
- select title and dir for the project
- select gui wxSmith and Frame based
- select wxWidgets' location "C:\wxWidgets-2.8.12"
- select Release configuration (or Debug if you have built with Debug option)
- select only "wxWidgets is built as monolithic library"
6] in Project
Build option
Compiler Settings
Other Options
delete "-mthreads" option
7] in Project
Build option
Linker Settings
Other linker Options
delete "-mthreads" option
add "-static-libgcc" option
that's it!!! :)
Hoping this could help... :)
PS thanx to http://dev.arqendra.net/#cbnb where I got some good advice...
ollydbg:
very nice tutorials. hope it can put in wiki. but I guess the wiki has already some similar materials. :D
Diazepam:
I used
- C:\wxWidgets-2.9.4\build\msw
- echo %PATH% (to see if i still have C:\Program Files (x86)\CodeBlocks\MinGW\bin), and I do.
- mingw32-make.exe -f makefile.gcc clean
- mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 RUNTIME_LIBS=static SHARED=0
I opened Code::Blocks and I tryed to make a new project.
However, it didn't allow me to make a new project only with monolithic. It obligated me to use "Use WX dll" and "use unicode" too. This is my old build. I want to change it to what you instructed because I need a stand-alone exe, and the old build has SHARED=1 and doesn't have static runtime_libs.
What am I doing wrong?
Diazepam:
Should I just reinstall Windows ?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version