Exe on blocks of code is almost 57 times more than the same code created by Visual Studio

This code:

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello world!\n";
    return 0;
}

when comiled gives a size of 457KB in Code :: Blocks with GCC 4.4.1 and only 8KB (eight) in VS2010. Both compilers are optimized for size.

Does anyone know why such a difference?

+3
source share
2 answers

You are right, the gcc executable is obviously larger, in your case 57 times more than the built-in vC ++.

The main reason is that GCC will not require any external dependencies to run, while with VS2010 it will take at least the runtime of the files that will be present on the system.

, , vs2010, , ​​ XP, VS2010.

, GCC, , , VS2010, ().

, , , , , :)

+1

, ++ g++, VS . gcc cygwin , exe C-.

#include <stdio.h>
int main() {
  printf("Hello world\n");
  return 0
}

, EXE gcc, - ++.

+6

Source: https://habr.com/ru/post/1792158/


All Articles