login about faq

I'm using the C++ HTTP lib with WinCE 6.0 on an embedded payment terminal. Linking in the Chilkat lib has increased the size of both the Release and Debug versions of the resulting executables (makes sense). While both have doubled in size, my problem is with the Debug executable - it is now over 5 Megs in size which is too large to load onto the target device (according to VS). I'm only using the CkHttp and CkHttpResponse classes, is there any way to cut down the size of the .exe?


asked Jun 06 '16 at 23:36

tdginctr's gravatar image


I answered my own question - there is a way to curb the bloat. The following will stop the linker from linking-in unused and/or duplicate code:

  • open the Properties setting for the project (MainWnd). Make sure that the Configuration is set to “Debug”
  • under Configuration Properties->Linker->Optimization, set the following:
  • “References” to “Eliminate Unreferenced Data (/OPT:REF)
  • “Enable COMDAT Folding” to “Remove Redundant COMDATs (/OPT:ICF)

  • the next setting is optional, although you will get a warning if you don’t change it - under Configuration Properties->Linker->General, set the following:

  • “Enable Incremental Linking” to “Default” or “No” (just can’t be “Yes”).

In my case these changes caused the size of the Debug executable to drop from 5.2 Megs to 3.3 Megs.


answered Jun 09 '16 at 21:22

tdginctr's gravatar image


When a program is linked with a static library, the linker only includes the library code that is directly or indirectly referenced. This is true regardless of the operating system and regardless of the compiler/linker (gcc, vc++, QT, etc.)

Therefore, it's not possible to cut down on the size. Implementing HTTP/HTTPS touches upon most everything in the underlying infrastructure: encryption, hashing, public-key algorithms, MIME, TLS, TCP, the HTTP protocol itself, proxies, tunneling, authentication, character encoding, etc. The only reason the given functionality is available on older platforms (and cross-language/cross-platform) is because Chilkat implements it all directly -- and this adds to the size. If Chilkat didn't then the features and reliability/sameness of Chilkat's behavior cross-platform would not be possible (and Chilkat certainly wouldn't be possible on WinCE 6.0).


answered Jun 07 '16 at 09:08

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jun 06 '16 at 23:36

Seen: 1,347 times

Last updated: Jun 09 '16 at 21:22

powered by OSQA