Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: reason2breathe on July 22, 2009, 06:28:45 pm

Title: Creating a Stand-alone file
Post by: reason2breathe on July 22, 2009, 06:28:45 pm
Hello all,
I have searched high and low for this, but I can't seem to find it anywhere:
Is there any way to save your project as a standalone file from within Codeblocks, so that it can be run without needing to use Codeblocks?
What i mean is an export to .exe function or something like that. If it's obvious, i apologise, cos i really can't fnd it!

Thanks very much

Jonathan
Title: Re: Creating a Stand-alone file
Post by: stahta01 on July 22, 2009, 08:05:52 pm
Your question is vague to me; two answers based on two different reading of question.

I know of no plugin for Code::Blocks needed to create an installer.

There is an export to makefile plugin by a third party for building project via a makefile.

Tim S
Title: Re: Creating a Stand-alone file
Post by: olebon on July 22, 2009, 10:13:48 pm
If I understood Jonathan well, he is asking about a possibility to compile a project as a huge (3-4MB) exe file, not an 80k executable that will not work on another machine without installed wxWidgets dlls. At least this is what I am trying to check and it looks like this is impossible with CodeBlocks. I could do it easily with wxDev-C++, but this seems to be their only advantage.
Title: Re: Creating a Stand-alone file
Post by: reason2breathe on July 22, 2009, 10:42:08 pm
I didn't even know you could compile it as a small executable! I'm entirely new to this! How would one go about that, because that sounds entirely sufficient for my needs. Thank you for your replies so far!
Title: Re: Creating a Stand-alone file
Post by: olebon on July 22, 2009, 11:10:51 pm
If you are using wxWidgets there are 2 options - either to compile to something around 80k and keep a couple of libraries like "wxmsw28_gcc.dll" reachable through the PATH environment variable (in total ~10MB) or have a 4MB exe file including all it needs to run. I would prefer the second option, but don't know how to set it up. In wxDev-C++ it is very easy, probably I'll have to compare two makefiles and find the difference.
Title: Re: Creating a Stand-alone file
Post by: oBFusCATed on July 23, 2009, 07:09:19 am
It looks like in wxDev-C++ your application is link to static wx library, that's why you don't need the wx.dll.
You can achieve the same thing with C::B, but I don't know how (maybe you need to find wx static lib and link against it)
Title: Re: Creating a Stand-alone file
Post by: stahta01 on July 23, 2009, 08:18:56 am
It looks like in wxDev-C++ your application is link to static wx library, that's why you don't need the wx.dll.
You can achieve the same thing with C::B, but I don't know how (maybe you need to find wx static lib and link against it)

IIRC, Try unchecking use DLL in wizard. Tim S.
Title: Re: Creating a Stand-alone file
Post by: thomas on July 23, 2009, 10:30:47 am
Well, you need not use wxWidgets at all to get an executable. Luckily :)
All you need to do is make any kind of normal project (for example console program or Win32 program) and hit "compile", it will create a standalone executable in the location that is given in the project's options.
Title: Re: Creating a Stand-alone file
Post by: reason2breathe on July 23, 2009, 12:53:03 pm
Aha! Fantastic. what's the difference between debug and release?
Title: Re: Creating a Stand-alone file
Post by: thomas on July 23, 2009, 02:36:04 pm
The size of the executable, and the ability to debug the program. You may want to read a beginner's book of C/C++ programming and consult the MinGW/gcc documentation for those basic concepts.