Pelles C forum

C language => Beginner questions => Topic started by: whatsup on May 20, 2010, 08:17:47 AM

Title: reduce file size
Post by: whatsup on May 20, 2010, 08:17:47 AM
hay all,
my pocc argument are:
-W1 -Go -Ze -Zx -MT

so it uses a default library.

the minimum file size i'm getting is 18K
is there a way to use other lib and reduce exe file size ?

(without using upx ofcourse)

thanks in advanced
Title: Re: reduce file size
Post by: TimoVJL on May 20, 2010, 09:05:11 AM
What kind of program ?
Console or GUI ?

Is these needed ?
-MT multi-threading ?
-Go oldnames ?

Only programs with small amount code and without runtime-library can be small sized.
For example GUI program just using Win32-API functions.
Title: Re: reduce file size
Post by: whatsup on May 20, 2010, 09:13:46 AM
thanks for fast reply.
i found that when i set -MD
the size is as i expected 2k
even when i use runtime - printf
so can you just tell me which dll it uses ?
i guess that the standard of visual C  msvcr70.dll (or something like this)
Title: Re: reduce file size
Post by: AlexN on May 20, 2010, 10:20:07 AM
Quote from: whatsup on May 20, 2010, 09:13:46 AM
thanks for fast reply.
i found that when i set -MD
the size is as i expected 2k
even when i use runtime - printf
so can you just tell me which dll it uses ?
i guess that the standard of visual C  vc70.dll (or something like this)

It uses pocrt.dll, which is a part of Pelles C. You also can use msvcrt.dll, when you link with msvcrt.lib (this library is not included at version 6, but you can get it from version 5 of Pelles C). And this DLL is included in the most version of Windows.
Title: Re: reduce file size
Post by: whatsup on May 20, 2010, 10:43:07 AM
many thanks man, that helped.
Title: Re: reduce file size
Post by: Vortex on May 20, 2010, 10:18:32 PM
You can use custom C run-time startup modules to reduce the .exe size. A GUI application can be 2 Kb with this method.

Tiny C run-time startup module for console applications (http://forum.pellesc.de/index.php?topic=88.0)
Title: Re: reduce file size
Post by: whatsup on May 29, 2010, 08:57:33 PM
thank you very very very much sir.
this is exactly what i was looking for.