如何修复编译器只读文件中的"c1001: An internal error..."?

How to fix "c1001: An internal error..." in compiler read-only file?

本文关键字:c1001 An internal error 编译器 何修复 只读 文件      更新时间:2023-10-16

我是Qt的新手,已经使用创建者(v3.4.1.)设计了我的第一个GUI。我已经对程序的一些核心进行了编码,但现在我只想测试GUI。当我试图构建项目时,我得到了错误:

C1001:编译器中发生内部错误。

C: \Program Files(x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0:61

xmemory() 中的代码如下:注意:第61行是特定的错误行

58    template<> inline
59      void _Destroy(char *)
60      {   // destroy a char (do nothing)
61      }

作为新手,我甚至不确定这行代码在我的项目上下文中应该做什么。任何见解或解决方案都将不胜感激。感谢

编辑:好吧,我找到了一些问题的解释,但我不知道如何实现它的简化修复建议,因为我没有对它进行编码,创建者做到了。不管怎样,这就是它所说的:

CPSC542_-_Gradebook" -I"." -I"D:QtQt5.4.25.4msvc2013_64include" -I"D:QtQt5.4.25.4msvc2013_64includeQtWidgets" -I"D:QtQt5.4.25.4msvc2013_64includeQtGui" -I"D:QtQt5.4.25.4msvc2013_64includeQtANGLE" -I"D:QtQt5.4.25.4msvc2013_64includeQtCore" -I"debug" -I"." -I"D:QtQt5.4.25.4msvc2013_64mkspecswin32-msvc2013" -Fodebug @C:UsersLouisAppDataLocalTempmoc_mainwindow.obj.77700.15.jom
moc_mainwindow.cpp
C:Program Files (x86)Microsoft Visual Studio 12.0VCINCLUDExmemory0(61) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'msc1.cpp', line 1325)
 To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++ 
 Help menu, or open the Technical Support help file for more information
Internal Compiler Error in C:Program Files (x86)Microsoft Visual Studio 12.0VCBINamd64cl.exe.  You will be prompted to send an error report to Microsoft later.
jom: C:UsersLouisDesktopbuild-CPSC542_-_Gradebook-Desktop_Qt_5_4_2_MSVC2013_64bit-DebugMakefile.Debug [debugmain.obj] Error 1
jom: C:UsersLouisDesktopbuild-CPSC542_-_Gradebook-Desktop_Qt_5_4_2_MSVC2013_64bit-DebugMakefile.Debug [debugmainwindow.obj] Error 1
jom: C:UsersLouisDesktopbuild-CPSC542_-_Gradebook-Desktop_Qt_5_4_2_MSVC2013_64bit-DebugMakefile.Debug [debugmoc_mainwindow.obj] Error 1
jom: C:UsersLouisDesktopbuild-CPSC542_-_Gradebook-Desktop_Qt_5_4_2_MSVC2013_64bit-DebugMakefile [debug] Error 2
15:22:56: The process "D:QtQt5.4.2ToolsQtCreatorbinjom.exe" exited with code 2.
Error while building/deploying project CPSC542_-_Gradebook (kit: Desktop Qt 5.4.2 MSVC2013 64bit)
When executing step "Make"
15:22:56: Elapsed time: 00:01.

第2版:好吧,这就是项目中的所有代码。这基本上是一个空白项目,但它在3台不同的计算机上出现了与上面相同的错误(只是彻底)。

主窗口.h:

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H

main.cpp

#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}

mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}
MainWindow::~MainWindow()
{
    delete ui;
}

mainwindow.ui

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>1146</width>
    <height>629</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralWidget"/>
  <widget class="QMenuBar" name="menuBar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>1146</width>
     <height>21</height>
    </rect>
   </property>
  </widget>
  <widget class="QToolBar" name="mainToolBar">
   <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
   </attribute>
   <attribute name="toolBarBreak">
    <bool>false</bool>
   </attribute>
  </widget>
  <widget class="QStatusBar" name="statusBar"/>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <resources/>
 <connections/>
</ui>

所以,我刚刚卸载/重新安装了所有东西(Qt Creator、VS2013、Win-Debug工具)。这很痛苦(因为他们都必须再次下载),但它起到了作用。如果其他人有此问题,请首先重新启动Windows。然后检查您的构建设置、编译器设置,然后解构您的项目(以防出现错误代码)。如果这不起作用,那就做我最终必须做的事情,卸载/重新安装所有东西。希望事情不会变成那样。谢谢大家。

相关文章: