2

I need to create exe file smaller that 64KB. In previous project I was able to do 4KB by using crinkler and not using any classes or std library. I'm using Visual Studio Express 2012.

In my current project I'm using classes a lot, but I would like to use crinkler. I'm getting errors like that one

Error 1 error LNK: Cannot find symbol '??3@YAXPAX@Z'

I was searching Google for solution. Here somebody wrote to don't use std, but I'm not using anything from namespace std.

Is there a special way to make it work with classes?

Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
LovelyHanibal
  • 317
  • 2
  • 13
  • have you tried other tools like http://upx.sourceforge.net/ ? – AndersK Sep 19 '13 at 16:39
  • `??3@YAXPAX@Z` translates to `void __cdecl operator delete(void *)`. Are you linking with the appropriate CRT? – IInspectable Sep 19 '13 at 16:45
  • Yes. I was trying upx. After using upx my intro have about 100KB, it's still to much. I have lot of unused code. Clinker can detect and remove unused code. Upx seem to not doing it. – LovelyHanibal Sep 19 '13 at 16:50
  • I'm linking with /MT. I was also trying to link with /MD, but the result was the same. – LovelyHanibal Sep 19 '13 at 16:51
  • 1
    You do have libctiny set up, I hope? – MSalters Sep 19 '13 at 22:06
  • I didn't. Now when I'm trying to do so, but I have unsolved functions. sin, cos, etc I can define by my self (I prefer if I don't have to). But there is a problem with wWinMain. If I define my main function as wWinMain, then I got error that _wWinMainCRTStartup is not defined. If I define my main function as _wWinMainCRTStartup then wWinMain is undefined. Therefore I think that LIBCTINY is only for command line applications. – LovelyHanibal Sep 27 '13 at 00:35
  • An older version of Visual Studio should generate smaller files. Of course you should compile it in Release mode too. There are many project properties you can adjust to reduce the file size, but right now I don't remember exactly. – Havenard Apr 22 '14 at 23:34
  • It is old topic now. – LovelyHanibal Mar 16 '15 at 19:30
  • The solution for my problem was to compile project with option "/MT" and use Mew11 to compress it. – LovelyHanibal Mar 16 '15 at 19:33

0 Answers0