【发布时间】:2021-01-05 04:39:47
【问题描述】:
我在 Codelite IDE 中输入二维数组时遇到问题。构建日志是-
C:\Windows\system32\cmd.exe /C ""C:/Program Files/mingw-w64/mingw64/bin/mingw32-make.exe" -j8 SHELL=cmd.exe -e -f Makefile" "----------Building project:[ test - Debug ]----------" mingw32-make.exe[1]: Entering directory 'C:/Users/CHIRAYU/Documents/CODING/PRACTICE/array/test' "C:/Program Files/mingw-w64/mingw64/bin/g++.exe" -c "C:/Users/CHIRAYU/Documents/CODING/PRACTICE/array/test/main.cpp" -g -O0 -std=c++17 -Wall -o Debug/main.cpp.o -I. -I. during RTL pass: expand C:/Users/CHIRAYU/Documents/CODING/PRACTICE/array/test/main.cpp: In function 'int main()': C:/Users/CHIRAYU/Documents/CODING/PRACTICE/array/test/main.cpp:10:9: internal compiler error: in make_decl_rtl, at varasm.c:1322 int matrix[m][n]={}; ^~~~~~ libbacktrace could not find executable to open Please submit a full bug report, with preprocessed source if appropriate. See <https://sourceforge.net/projects/mingw-w64> for instructions. mingw32-make.exe[1]: *** [test.mk:98: Debug/main.cpp.o] Error 1 mingw32-make.exe[1]: Leaving directory 'C:/Users/CHIRAYU/Documents/CODING/PRACTICE/array/test' mingw32-make.exe: *** [Makefile:5: All] Error 2 ====1 errors, 0 warnings====
使用的代码是-
//entering a matrix of user input size and displaying it
#include <iostream>
using namespace std;
int main(){
int m{},n{}; //m- number of rows; n - number of columns
cout<<"Enter the number of rows and columns separated by space "<<endl;
cin>> m >> n;
int matrix[m][n]={};
for(int i{0}; i<m; i++){
for(int j{0}; j<n; j++){
cout<<"Enter the "<<i<<" x "<<j<<" element"<<endl;
cin>>matrix[i][j];
}
}
cout<<"The entered matrix is: "<<endl;
for(int a{0}; a<n; a++){
for(int b{0}; b<n; b++){
cout<<matrix[a][b]<<" ";
}
cout<<endl;
}
cout << endl;
return 0;
}
【问题讨论】:
标签: c++ arrays compiler-errors mingw