相关疑难解决方法(0)

GCC C++"Hello World"程序 - > .exe在Windows上编译时大500kb.如何减小尺寸?

我刚刚开始学习C++ - 我在Windows上使用nuwen的MingW版本,使用NetBeans作为IDE(我也有MSDN AA版本的MSVC 2008,尽管我不经常使用它).

编译这个简单的程序时:

#include <iostream>
using namespace std;

int dog, cat, bird, fish;

void f(int pet) {
  cout << "pet id number: " << pet << endl;
}

int main() {
  int i, j, k;
  cout << "f(): " << (long)&f << endl;
  cout << "dog: " << (long)&dog << endl;
  cout << "cat: " << (long)&cat << endl;
  cout << "bird: " << (long)&bird << endl;
  cout << "fish: " << (long)&fish << endl; …
Run Code Online (Sandbox Code Playgroud)

c++ size optimization gcc netbeans

30
推荐指数
5
解决办法
3万
查看次数

标签 统计

c++ ×1

gcc ×1

netbeans ×1

optimization ×1

size ×1