Author Topic: Creating a Stand-alone file  (Read 13759 times)

Offline reason2breathe

  • Single posting newcomer
  • *
  • Posts: 3
Creating a Stand-alone file
« 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Creating a Stand-alone file
« Reply #1 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

olebon

  • Guest
Re: Creating a Stand-alone file
« Reply #2 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.

Offline reason2breathe

  • Single posting newcomer
  • *
  • Posts: 3
Re: Creating a Stand-alone file
« Reply #3 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!

olebon

  • Guest
Re: Creating a Stand-alone file
« Reply #4 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Creating a Stand-alone file
« Reply #5 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)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Creating a Stand-alone file
« Reply #6 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Creating a Stand-alone file
« Reply #7 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline reason2breathe

  • Single posting newcomer
  • *
  • Posts: 3
Re: Creating a Stand-alone file
« Reply #8 on: July 23, 2009, 12:53:03 pm »
Aha! Fantastic. what's the difference between debug and release?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Creating a Stand-alone file
« Reply #9 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."