gpt4 book ai didi

c++-cli - C++ fatal error c1001 :an internal error has occurred in the compiler

转载 作者:行者123 更新时间:2023-12-04 23:52:42 25 4
gpt4 key购买 nike

我必须将 C++ 与 dot net C++ 混合使用。我看到这个错误。我已经用谷歌搜索了很多。试了很多方法。还是行不通。任何帮助表示赞赏。

int _tmain(int argc, _TCHAR* argv[])
{

typedef struct
{
char all_srting[200];
char name_1[100];
char Max_1[100];
char Min_1[100];
}power_line_name;

int numLines;
StreamReader ^ sr1=File::OpenText("powerline.txt");
while(sr1->ReadLine())
{
numLines++;
}
power_line_name* power_list=new power_line_name[numLines];

StreamReader ^ sr=File::OpenText("powerline.txt");
array<System::String ^> ^power_line;
array<System::String ^> ^power_line_nospace;
array<System::String ^> ^d_line;
array<System::String ^> ^all_powrline_string;
int i=0;
char nstring[100];

try
{
String^ s="";
while (s=sr->ReadLine())
{
power_line=s->Split(':');
power_line_nospace=power_line[1]->Split(' ');
d_line=power_line_nospace[1]->Split('|');
for(int a=0;a<d_line->Length;a++)
{
pin_ptr<const wchar_t> wch = PtrToStringChars(d_line[a]);
size_t origsize = wcslen(wch) + 1;
size_t convertedChars = 0;
if(a==0)
{
wcstombs_s(&convertedChars, power_list[i].name_1, origsize, wch, _TRUNCATE);
//strcat_s(power_list[i].name_1, " (char *)");
}
if(a==1)
{
wcstombs_s(&convertedChars, power_list[i].Max_1, origsize, wch, _TRUNCATE);
//strcat_s(power_list[i].Max_1, " (char *)");
}
if(a==2)
{
wcstombs_s(&convertedChars, power_list[i].Min_1, origsize, wch, _TRUNCATE);
//strcat_s(power_list[i].Min_1, " (char *)");
}

}
i++;

}



Console::WriteLine(s);
}
finally
{
if(sr)
delete (IDisposable^)(sr);
}

return 0;
}

我收到此消息:power_line=s->Split(':');<-----fatal error c1001:an internal error has occurred in the compiler

error fatal error lnk1000 internal error during image::bulidimage

我能做什么?

最佳答案

我在使用 boost::iequals 比较两个 std::string 时遇到了同样的错误,如下所示:

std::for_each(bds.begin(),bds.end(),[&](std::string str){if(boost::iequals("must",str)) printf("matched\n");});

我使用 vs 2010 和 boost 版本 1.58 编译了这段代码。

要解决这个错误,只需将 std::for_each() 替换为 for()。所以我猜编译器和增强库有冲突。

关于c++-cli - C++ fatal error c1001 :an internal error has occurred in the compiler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24861335/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com