473,549 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Downloaded Bloodshed devcpp, compiled the Hello example but the exe is half a megabyte!?

So I just downloaded Bloodshed devcpp, opened up the Hello example, compiled
it, no problems ..... well, except one - the exe is 474,990 bytes!
What's the secret to compiling small exes?
Thanks
Oct 29 '07 #1
30 3770
* Dave -Turner:
So I just downloaded Bloodshed devcpp, opened up the Hello example, compiled
it, no problems ..... well, except one - the exe is 474,990 bytes!
What's the secret to compiling small exes?
Thanks

This is the place to ask questions about Dev-C++:
http://sourceforge.net/forum/forum.php?forum_id=48211

--
Derek
Oct 29 '07 #2
mmk thanks .... but what c++ compilers are we allowed to ask questions about
here in comp.lang.c++ ?
Oct 29 '07 #3
On Oct 29, 8:26 am, "Dave -Turner" <n...@no.nowrot e:
mmk thanks .... but what c++ compilers are we allowed to ask questions about
here in comp.lang.c++ ?
In this group concepts regarding the *The standard C++ language* are
discussed. If the answer to the question depends on idndividual
implementation/compiler/OS then this is probably not the appropriate
place to discuss them.

You can read more about comp.lang.c++ here :
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

-N

Oct 29 '07 #4
Dave -Turner wrote:
mmk thanks .... but what c++ compilers are we allowed to ask questions
about here in comp.lang.c++ ?
None. See the FAQ for a more detailed account on topicality.
There are exceptions. One case where asking about particular compilers is
fine is when two compilers disagree on legality or meaning of code. Then it
is topical to ask which (if any) compiler is right. In these cases, the
information about the compiler is by and large immaterial. Hint: if you can
replace the names of the compilers by X and Y and there still would be a
meaningful answer, it is probably topical.

Best

Kai-Uwe Bux
Oct 29 '07 #5
On Oct 29, 4:07 am, "Dave -Turner" <n...@no.nowrot e:
So I just downloaded Bloodshed devcpp, opened up the Hello
example, compiled it, no problems ..... well, except one - the
exe is 474,990 bytes! What's the secret to compiling small
exes?
Getting the compiler and linker options right:-). It all
depends on the compiler, and also what you mean by the size of
the executable (file size, or what the command size says), but
all systems I've used have options controlling the amount of
debug information (symbols, etc) left in the executable, and
most also have options for linking more or less of the standard
library dynamically. Strip all of your symbols, and link
everything dynamically, and the resulting executable shouldn't
be too big. Thus, for example, with g++ on a Sparc, one simple
C++ version of hello world is 7.7KB when the libraries are
dynamically linked, but more than 3 MB when everything is linked
statically.

Be careful about this, though. File size is rarely that
important, and if you link dynamically, you have to ensure that
the necessary dll or so are present on the target machine where
the code is to run. And if you link statically, you have to
ensure that the version of the library you link is compatible
with the OS on the target machine. Under Unix, for example, I
generally link everything but the system libraries (libc, libm,
etc.) statically---the system libraries are bundled with the
system (and so sure to be present on all machines running the
OS), and tend not to be compatible between versions of the OS.
Under Windows, I'd statically link the system libraries as well,
since they aren't bundled (and individual versions do seem to
work under different versions of the OS). This results in much
larger executable files, but 1) all I have to do to install the
program so that it works is copy the single, executable file,
and 2) the versions of the library which I tested are the same
as those which the user uses. For third party libraries, you'll
want to decide on a per library basis: licensing issues will
frequently require the library to be present on the target
system anyway, and using dynamic linking may allow upgrading the
version (e.g. of the database) without requiring a new
deployment of your software.

Similarly, if you strip symbols, the executable you deliver will
be much smaller, but you'll have a much harder time figuring out
what went wrong if it crashes at the user site. (Again, the
criteria are different for Unix and Windows---Windows doesn't
normally give you a core dump on which you can do a post
mortum, so the lack of symbols may not be a problem.)

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Oct 29 '07 #6
On Oct 29, 4:49 am, Kai-Uwe Bux <jkherci...@gmx .netwrote:
Dave -Turner wrote:
mmk thanks .... but what c++ compilers are we allowed to ask questions
about here in comp.lang.c++ ?
None. See the FAQ for a more detailed account on topicality.
There are exceptions. One case where asking about particular
compilers is fine is when two compilers disagree on legality
or meaning of code. Then it is topical to ask which (if any)
compiler is right. In these cases, the information about the
compiler is by and large immaterial. Hint: if you can replace
the names of the compilers by X and Y and there still would be
a meaningful answer, it is probably topical.
More generally, questions about specific compiler options, etc.,
are off topic, but there are often generalities which apply to
many different compilers, which are perfectly acceptable. Thus,
I have no idea what Bloodshed is as a compiler, and couldn't
begin to tell him what options he should be using, even if it
were on topic. But I know that generally, there are two things
that have a very large effect on the size of an executable; by
playing with the amount of debugging information in the
executable, and how much is dynamically linked, I can vary the
size of hello, world from 4.8KB to over 3MB with g++ under
Solaris. The exact sizes on other systems will be different,
but such ranges are typical. Telling him that he has to look
for the options of his compiler which control the amount of
debug information and what is linked statically or dynamically
is certainly on topic, as is telling him that there are a lot
more important considerations than just executable file size
which have to be taken into account.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Oct 29 '07 #7
Ok well, I asked at the Bloodshed forum as suggested and although this issue
has been discussed somewhat there doesn't seem to be any apparent solution
to it other than 1) make sure debugging info isnt being included, and 2)
make sure Strip Executable in compiler options is turned on.
That managed to get the exe down to 263kb, but that's seemingly as small as
it'll get, so that forum seemed somewhat useless. I can make the same exe
using lcc in around 3kb.

But because I can't talk about DevCpp here I guess this newsgroup is equally
useless to ask for help. Perhaps you should rename it to something more
suitable, I can think of a few suggestions.
Oct 30 '07 #8
On 2007-10-30 02:56, Dave -Turner wrote:
Ok well, I asked at the Bloodshed forum as suggested and although this issue
has been discussed somewhat there doesn't seem to be any apparent solution
to it other than 1) make sure debugging info isnt being included, and 2)
make sure Strip Executable in compiler options is turned on.
That managed to get the exe down to 263kb, but that's seemingly as small as
it'll get, so that forum seemed somewhat useless. I can make the same exe
using lcc in around 3kb.
Just a though, might it be that the compiler you are using with
Bloodshed is unable to produce a smaller executable? All compilers are
not equal when it comes to generating code, so produces small code some
produces large, some fast, and some slow.
But because I can't talk about DevCpp here I guess this newsgroup is equally
useless to ask for help. Perhaps you should rename it to something more
suitable, I can think of a few suggestions.
This groups is very aptly named, it is not comp.lang.c++ compilers, or
comp.lang.c++.b loodshed, it is just comp.lang.c++ which reflects quite
well what we discuss here. Let us take a quick look at the components
for a while. The "comp" tells us that what is discussed is related to
computers in some why, the "lang" means that we discuss a computer
language, and the "c++" means that it is the c++ computer language we
are discussing. Had it been comp.c++ compilers might have been on topic
but that is not the case so they are not.

--
Erik Wikström
Oct 30 '07 #9

"Erik Wikström" <Er***********@ telia.comwrote in message
news:Rh******** *********@newsb .telia.net...
On 2007-10-30 02:56, Dave -Turner wrote:
>Ok well, I asked at the Bloodshed forum as suggested and although this
issue
has been discussed somewhat there doesn't seem to be any apparent
solution
to it other than 1) make sure debugging info isnt being included, and 2)
make sure Strip Executable in compiler options is turned on.
That managed to get the exe down to 263kb, but that's seemingly as small
as
it'll get, so that forum seemed somewhat useless. I can make the same exe
using lcc in around 3kb.

Just a though, might it be that the compiler you are using with
Bloodshed is unable to produce a smaller executable? All compilers are
not equal when it comes to generating code, so produces small code some
produces large, some fast, and some slow.
I'm simply using the default as-is installation of Bloodshed Dev-Cpp. If
you go to their site and download it now youll have exactly what i've got.
>But because I can't talk about DevCpp here I guess this newsgroup is
equally
useless to ask for help. Perhaps you should rename it to something more
suitable, I can think of a few suggestions.

This groups is very aptly named, it is not comp.lang.c++ compilers, or
comp.lang.c++.b loodshed, it is just comp.lang.c++ which reflects quite
well what we discuss here. Let us take a quick look at the components
for a while. The "comp" tells us that what is discussed is related to
computers in some why, the "lang" means that we discuss a computer
language, and the "c++" means that it is the c++ computer language we
are discussing. Had it been comp.c++ compilers might have been on topic
but that is not the case so they are not.
Well let's see .....
comp.* .... yes, I'm enquiring about a computer language, which is computer
related
comp.lang.* .... yes, again I'm enquiring about a computer language
comp.lang.c++ .... yes, I'm enquiring about a computer language, and yes
it's c++.

BUT NO.
So apparently my only fault was mentioning the word "Bloodshed" , because
other than that it wouldve been "generic". <insert wanking notions here>

How about changing the name to
comp.lang.c++.d ont.ask.we're.a bsolutely.blood y.useless ??? At least then
newcomers would know what this newsgroup is about - I wouldn't have bothered
wasting mine (or your) time if I had've known that this newsgroup was
useless when it comes to c++-related questions.

Oct 30 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4408
by: Developwebsites | last post by:
I have tried out these C++ compilers: Watcom 11.0c - simply does not work. now they bundled fortran with c++ but it just doesnt install on my pc. digi-mars DOS - good, fast, small. however, no IDE, no editor, etc. borland command line tools 5.5 - installed but gives errors on programs which compile fine in 4.52. WHY?
2
1541
by: PointNot | last post by:
I'm coding in Dev C++ by bloodshed my questions are.... I want to learn to create GUI windows interfaces, can I do it in here. I've never learned the visual aspect of C++ yet, and would like to learn, any good sites to help me out. THanks
1
1354
by: Jose Garcia | last post by:
Hi... I am wrinting a win32-aplicattion that not uses classes. I use stdio.h and iostream for example, and, the operators new & delete for memory. Then... Is "licit" to mix c & c++ code, compiled as c++, without OOP ?? Or.. maybe i have to translate to only C code and forget "cout <<", new, delete, etc... if I not use objectes and...
0
1160
by: bob | last post by:
I'm using Bloodshed Dev-C++, and I'm getting ready to distribute a program I made with it. Does anyone know how to change the icon of the program? I'm not sure how resources work in Bloodshed, and the documentation on this seems nonexistent.
6
2329
by: PCHOME | last post by:
Hi! I am looking for a good free IDE C Compiler. Dose any have experience on using them? Which is better? Bloodshed C or Miracle C? Or anyother free IDE C Compiler you like to recomend? Thank you so much!
4
7009
by: John Smith | last post by:
My program includes a use of strstr(). It looks like this: if(strstr(*str1, *str2) ........... After compiling the code, I opened the program with a hex editor (this is on Windows). Sure enough, I found str2 in the compiled code. Is there a simple alternative (preferrably still using strstr) to achieve the same objective without...
6
2550
by: Earl Teigrob | last post by:
I am writing an application that dynamically loads user controls at run time based on user options. I would like to give my users the ability to build their own user controls and add them to my user control folder so that they can be selected and loaded at run time also. These new controls will need to have access to many of the classes with...
1
1675
by: Jim Langston | last post by:
I'm trying to compile some source code to interface LUA into C++. When I compile in MSVC++ Express 2008, however, I get the error (among others): ....\luastate.h(129) : error C2027: use of undefined type 'cpplua::LuaFunction' ....\luastate.h(63) : see declaration of 'cpplua::LuaFunction' So I'm trying to track this down. I see that...
40
2312
by: castironpi | last post by:
I'm curious about some of the details of the internals of the Python interpreter: I understand C from a hardware perspective. x= y+ 1; Move value from place y into a register Add 1 to the value in the register Move the addition's result to place x
0
7546
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7830
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6071
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5111
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
784
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.