Visual studio 2012编译时间慢

编程入门 行业动态 更新时间:2024-10-11 19:14:49
本文介绍了Visual studio 2012编译时间慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Visual studio 2012中有一个非常小的项目(只有50行代码)。我只有一个源文件( main.cpp )。但是它需要大约20秒或更多的时间来编译!我应该怎么加速呢?当我使用C#的编译时间很快,但是当涉及到C ++它是超级慢。

I have an extremely small project in visual studio 2012 (only 50 lines of code). I only have one source file (main.cpp). But yet it takes about 20 seconds or more to compile! How am I supposed to speed it up? When I use C# the compile times are fast but when it comes to C++ it's super slow.

至于我最小的计算机规格,我有一个i5处理器,4gb的ram它是一个四核。它不应该花这么长时间来编译只有50行长的东西。我应该怎么办?

As for my minimal computer specs, I have an i5 processor, 4gb of ram and it is a quad core. It shouldn't be taking this long to compile something that is only 50 lines long. What should I do?

我的代码:

#include<iostream> using namespace std; class Entity { protected: int health; public: void SetHealth(int value) { health = value; } void DisplayHealth() { cout << "Entity: " << health << endl; } }; class Player : public Entity { private: int xp; public: void DisplayHealth() { cout << "Player: " << health << endl; } }; class Enemy : public Entity { }; int main() { Player player; Entity *entity = &player; entity->SetHealth(10); player.DisplayHealth(); system("pause"); return 0; }

推荐答案

一些可能会阻碍性能的选项:清除%localappdata%\Microsoft\WebSiteCache 也清除out%localappdata%\temp文件夹。

Some options that might hold up performance: clear %localappdata%\Microsoft\WebSiteCache Also clear out %localappdata%\temp folder.

拔掉您的n / w电缆,尝试(或打开无线连接)。

Unplug your n/w cable and try (or turn of wireless connection).

同样在tools \options\debugging中:禁用编辑并继续。 您可能正在生成MAP,PDB等...查看您的需求和您不需要的。

Also in tools\options\debugging: disable edit and continue. you might be generating MAP, PDB etc... See what you need and what you don't.

有些人报告说,加速'帮助(选项)!

Some people have reported that turning of "hardware acceleration' helps (options)!

检查你的PCH(预编译的头文件),看看它是否已经变得太大了。

Check your PCH (pre compiled header file) and see if it has grown too big.

允许增量链接,以便始终不会构建任何内容。

Allow incremental linking so that everthing is not being built all the time.

此外,请确保磁盘未碎片化。

Also, ensure that the disk is not fragmented.

更多推荐

Visual studio 2012编译时间慢

本文发布于:2023-11-05 03:12:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559747.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时间   Visual   studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!