While compiling on x64 plattform I am getting following error:
c:codavs05hpsw-scovpacctoolscodaaccesstestcoda_access.cpp(1572): fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:ddvctoolscompilerutcsrcp2sizeopt.c', line 55)
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
------ Build started: Project: asyncexample, Configuration: Release Win32 ------
If I change settings to preprocessor file (Yes) i am not getting any error.
About my environment: Upgrading Microsoft Visual Studio 2005 to 2010
Please help.
LuFFy
8,61910 gold badges40 silver badges59 bronze badges
asked Aug 16, 2011 at 10:01
4
I have had this problem with VS2015 while building locally in Windows.
In order to solve it, I deleted my build folder (Output Directory as seen in Properties/General) and rebuilt the project.
This always seems to help when strange things happen during the build.
answered Aug 2, 2017 at 8:36
AutexAutex
3072 silver badges12 bronze badges
I’ve encountered this error many times in VC++. Do the following steps. They’ve sometimes helped me with this issue:
- Take a look at the exact location, pointed out by compiler error.
- Find any external types or classes used there at that location.
- Change the order of “include path” of those files found in step 2 and rebuild the solution.
- I hope that help !!!!
answered Aug 16, 2011 at 10:17
TonySalimiTonySalimi
8,1534 gold badges32 silver badges62 bronze badges
0
I am getting same error with VC2012. Setting up the project properties Optimization to Disabled (/Od) resolved the issue.
answered Feb 3, 2014 at 12:27
anilanil
9711 gold badge11 silver badges23 bronze badges
2
In my solution, i’ve removed output dll file of the project, and I’ve made project rebuild.
answered Apr 27, 2017 at 16:52
Paweł IwaneczkoPaweł Iwaneczko
8431 gold badge10 silver badges13 bronze badges
I encountered the same error and spent quite a bit of time hunting for the problem. Finally I discovered that function that the error was pointing to had an infinite while loop. Fixed that and the error went away.
answered Mar 7, 2014 at 1:45
quiteProquitePro
5465 silver badges3 bronze badges
In my case was the use of a static lambda function with a QStringList argument. If I commented the regions where the QStringList was used the file compiled, otherwise the compiler reported the C1001 error. Changing the lambda function to non-static solved the problem (obviously other options could have been to use a global function within an anonymous namespace or a static private method of the class).
answered Jan 30, 2017 at 10:57
cbuchartcbuchart
10.7k8 gold badges50 silver badges91 bronze badges
I got this error using boost library with VS2017. Cleaning the solution and rebuilding it, solved the problem.
answered Feb 27, 2018 at 16:06
TidesTides
11111 bronze badges
I also had this problem while upgrading from VS2008 to VS2010.
To fix, I have to install a VS2008 patch (KB976656).
Maybe there is a similar patch for VS2005 ?
answered Jan 9, 2013 at 16:33
I got the same error, but with a different file referenced in the error message, on a VS 2015 / x64 / Win7 build. In my case the file was main.cpp. Fixing it for me was as easy as doing a rebuild all (and finding something else to do while the million plus lines of code got processed).
Update: it turns out the root cause is my hard drive is failing. After other symptoms prompted me to run chkdsk, I discovered that most of the bad sectors that were replaced were in .obj, .pdb, and other compiler-generated files.
answered Sep 6, 2016 at 22:54
hlongmorehlongmore
1,59523 silver badges28 bronze badges
I got this one with code during refactoring with a lack of care (and with templates, it case that was what made an ICE rather than a normal compile time error)
Simplified code:
void myFunction() {
using std::is_same_v;
for (auto i ...) {
myOtherFunction(..., i);
}
}
void myOtherFunction(..., size_t idx) {
// no statement using std::is_same_v;
if constexpr (is_same_v<T, char>) {
...
}
}
answered Nov 27, 2017 at 5:36
chrisb2244chrisb2244
2,93022 silver badges44 bronze badges
I had this error when I was compiling to a x64 target.
Changing to x86 let me compile the program.
answered Oct 17, 2017 at 14:38
Robert AndrzejukRobert Andrzejuk
5,0662 gold badges20 silver badges30 bronze badges
Sometimes helps reordering the code. I had once this error in Visual Studio 2013 and this was only solved by reordering the members of the class (I had an enum member, few strings members and some more enum members of the same enum class. It only compiled after I’ve put the enum members first).
answered Jun 12, 2019 at 13:51
In my case, this was causing the problem:
std::count_if(data.cbegin(), data.cend(), [](const auto& el) { return el.t == t; });
Changing auto to the explicit type fixed the problem.
answered Nov 13, 2019 at 15:06
Had similar problem with Visual Studio 2017 after switching to C++17:
boost/mpl/aux_/preprocessed/plain/full_lambda.hpp(203): fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'msc1.cpp', line 1518)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
Solved by using Visual Studio 2019.
answered Jan 15, 2020 at 12:04
DmytroDmytro
1,27217 silver badges21 bronze badges
I first encountered this problem when i was trying to allocate memory to a char* using new char['size']{'text'}, but removing the braces and the text between them solved my problem (just new char['size'];)
answered Jun 19, 2022 at 16:38
Another fix on Windows 10 if you have WSL installed is to disable LxssManager service and reboot the PC.
answered Aug 21, 2022 at 19:10
I have just upgraded Microsoft Visual Studio Enterprise 2015 from Update 2 to Update 3 and now I am getting the following error:
fatal error C1001: An internal error has occurred in the compiler.
(compiler file ‘f:ddvctoolscompilerutcsrcp2wvmmdmiscw.c’, line 2687)
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
The location is the first line which includes a header. The project has settings
/FR»x64Debug» /GS /W3 /Zc:wchar_t /Zi /Od /Fd»x64Debugvc140.pdb»
/Zc:inline /fp:precise /D «WIN32» /D «_DEBUG» /D «_WINDLL» /D
«_UNICODE» /D «UNICODE» /errorReport:prompt /WX- /Zc:forScope /clr
[some /FU»…»] /MDd /Fa»x64Debug» /EHa /nologo /Fo»x64Debug»
/Fp»….pch»
How do I make my project build again?
Leo Chapiro
13.6k7 gold badges60 silver badges92 bronze badges
asked Jul 8, 2016 at 11:59
4
C1001 basically indicates a compiler crash, i.e. you might have created valid C/C++ code that triggers a bug in the VC compiler. It would probably be a good idea to submit a bug report via https://connect.microsoft.com/VisualStudio/Feedback for further investigation by Microsoft.
I myself just ran into a C1001 while compiling OpenCV with Visual Studio Express 2015 Update 3. In my case, the C1001 error message also pointed me to the OpenCV core code line that triggers the compiler crash. After looking into the actual code semantics at that particular line, I suspected the compiler’s floating point handling to be the root cause of the issue. It was dealing with a big, hard-coded double array lookup table which might have caused rounding issues. (Just in case somebody googles for this, I am listing the reference here: opencv_core, mathfuncs_core.cpp, line 1261, macro-expansion of LOGTAB_TRANSLATE).
In my case, setting the compiler’s floating-point model from ‘precise’ to ‘strict’ resolved the C1001 issue. However, as you haven’t included a code fragment of the lines that cause the C1001 to raise, it’s difficult to say whether the above will fix your issue as well. If you want to give it a try, you can find the compiler switch in your project settings / C/C++ / Code Generation tab. Instead of Precise (/fp:precise), select Strict (/fp:strict) as Floating Point Model. This change may affect the performance of your code, but should not affect its precision. See https://msdn.microsoft.com/en-us/library/e7s85ffb.aspx for further information.
answered Jul 12, 2016 at 20:51
1
According to visual studio developers community,
this issue was fixed and closed (on July 2019) and should not appear at latest VS version. So upgrading to the latest version should solve the issue.
However, I’ve just now upgraded my VS to the latest version (16.7.1) and I still encounter this problem getting fatal error C1001: Internal compiler error.
An edit: See the comments below, people say the issue also appears at VS 2022 17.3.6 and at VS 2019 16.9.4
Finally, the following solution worked for me:
change the optimization option (project properties->C/C++->optimization) to ‘Custom’ and at (project properties->C/C++->command line’) add additional options of ‘/Ob2, /Oi, /Os, /Oy’.
taken from: Visual studio in stuck Generating code
answered Aug 16, 2020 at 10:21
2
The project was built on my system using boost_1_60 and cmake version 3.14.0. The prompt printed out that the build was successful, and I am able to open the project on Visual Studio 2019.
When I go to compile example_client.cpp , I get the following compiler error:
1>------ Build started: Project: example_server, Configuration: Debug x64 ------ 1>example_server.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: An internal error has occurred in the compiler. 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: (compiler file 'd:agent_work3ssrcvctoolsCompilerCxxFEslp1ctypes.c', line 4589) 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: To work around this problem, try simplifying or changing the program near the locations listed above. 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: Please choose the Technical Support command on the Visual C++ 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: Help menu, or open the Technical Support help file for more information 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(93): message : see reference to class template instantiation 'OpcUa::has_begin_end<T>' being compiled 1>Done building project "example_server.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have tried to fix by adjusting the last if statement of visualc.hpp to
if (MSC_VER > 1922)
instead of
if (MSC_VER > 1900)
Nevertheless, I still get the error listed above.
I also have problems with the variant. Can’t compile the library anymore:
2>D:projectscppfreeopcua-master-2019-08-21includeopc/ua/protocol/variant.h(87,1): error C1001: Interner Compilerfehler.
The project was built on my system using boost_1_60 and cmake version 3.14.0. The prompt printed out that the build was successful, and I am able to open the project on Visual Studio 2019.
When I go to compile
example_client.cpp, I get the following compiler error:
1>------ Build started: Project: example_server, Configuration: Debug x64 ------ 1>example_server.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: An internal error has occurred in the compiler. 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: (compiler file 'd:agent_work3ssrcvctoolsCompilerCxxFEslp1ctypes.c', line 4589) 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: To work around this problem, try simplifying or changing the program near the locations listed above. 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: Please choose the Technical Support command on the Visual C++ 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(87,1): error C1001: Help menu, or open the Technical Support help file for more information 1>C:UserssmedellinDocumentsopcuafreeopcuaincludeopc/ua/protocol/variant.h(93): message : see reference to class template instantiation 'OpcUa::has_begin_end<T>' being compiled 1>Done building project "example_server.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========I have tried to fix by adjusting the last if statement of
visualc.hpptoif (MSC_VER > 1922)
instead of
if (MSC_VER > 1900)
Nevertheless, I still get the error listed above.
So, did you solve it? I am having exactly the same problem :/
Yes, I managed to compile it, but that’s some months ago. As far as i remember I didn’t change the code. Perhaps you can try it with a newer version of boost.
Okey, thank you for the response
…
________________________________
From: AdmiralPellaeon <notifications@github.com>
Sent: Monday, May 11, 2020 10:28 AM
To: FreeOpcUa/freeopcua <freeopcua@noreply.github.com>
Cc: 614ir <ir_614@hotmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [FreeOpcUa/freeopcua] Visual Studio 2019 C1001: Internal Error has occurred (#338)
Yes, I managed to compile it, but that’s some months ago. As far as i remember I didn’t change the code. Perhaps you can try it with a newer version of boost.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#338 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/APRDI44UCA3LCIIQH4RUIMTRQ6ZK5ANCNFSM4IH6QVPA>.
I checked my files. Attached you find all src files with have a newer time stamp compared to the check out solution from git.
And I definetly use much newer version of boost.
changed_files.zip
- Remove From My Forums
-
Вопрос
-
Куда правильно сообщить об ошибке?
а то на https://connect.microsoft.com/VisualStudio/feedback/details/777151 послали.
________________
this code causes fatal error C1001: Internal compiler error
(file f:ddvctoolscompilerutcsrcP2ehexcept.c, line 971)Only x32 compiler. VS2010, VS2005.
________
int APIENTRY _tWinMain(HINSTANCE,HINSTANCE,LPTSTR,int)
{
char *p = (char *)50000;
try {
*p = 10;
} catch(char *) {
catch(…) { }
}
return 0;
}
Ответы
-
Привет
На Visual Studio 2012 — такая же ошибка, что на x86, что на x64. И по-моему здесь ошибка в коде у вас, а не компилятора.
Если вы хотите обработать возникающее исключение внутри первого catch — то вам нужно добавить блок try, иначе ничего не выйдет. catch сам по себе не может быть, и не может быть вложенным так, как вы пишите:
int main(int argc, _TCHAR* argv[]) { char *p = (char *)50000; try { *p = 10; } catch(char *) { try { // } catch(...) { } } return 0; }Если нужно обработать несколько разных ошибок, то располагайте блок catch последовательно:
int main(int argc, _TCHAR* argv[]) { char *p = (char *)50000; try { *p = 10; } catch(char *) { } catch(...) { } return 0; }
Для связи [mail]
-
Изменено
24 января 2013 г. 9:28
-
Помечено в качестве ответа
Abolmasov Dmitry
25 января 2013 г. 12:21
-
Изменено
-
Спасибо за компиляцию.
Да, я понимаю, что код неверный. Должен быть syntax error, а не internal compiler error.
(код получился в результате неверного использования макросов TRY/CATCH из MFC)
-
Помечено в качестве ответа
Abolmasov Dmitry
25 января 2013 г. 12:21
-
Помечено в качестве ответа
Visual Studio Professional 2013 Visual Studio Professional 2013 Visual Studio Premium 2013 Visual Studio Premium 2013 Еще…Меньше
Симптомы
При построении проекта Visual C++ в Visual Studio 2013 Update 5, использующий определенные типы из сборки .NET, может появиться следующее сообщение об ошибке:
Неустранимая ошибка C1001: Внутренняя ошибка в компиляторе.
(файл компилятора «f:ddvctoolscompilercxxfeslp1cesu.c», строка 6378)
Решение
Исправление от корпорации Майкрософт доступно. Тем не менее оно предназначено только для устранения проблемы, указанной в данной статье. Предлагаемое исправление должно применяться исключительно в системах, в которых обнаружена эта специфическая неполадка.
Чтобы устранить эту проблему, установите это исправление здесь.
Временное решение
Чтобы обойти эту проблему, не используйте последний тип, указанный в сообщении об ошибке. При использовании этого типа в других языках .NET, таких как C#, не подвержены рассматриваемой проблеме. Таким образом сборки оболочки могут создаваться для предоставления непрямой доступ уязвимого типа.
Ссылки
Дополнительные сведения о Visual Studio 2013 Update 5 Описание из Visual Studio 2013 обновления 5см.
Нужна дополнительная помощь?
While compiling on x64 plattform I am getting following error:
c:codavs05hpsw-scovpacctoolscodaaccesstestcoda_access.cpp(1572): fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:ddvctoolscompilerutcsrcp2sizeopt.c', line 55)
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
------ Build started: Project: asyncexample, Configuration: Release Win32 ------
If I change settings to preprocessor file (Yes) i am not getting any error.
About my environment: Upgrading Microsoft Visual Studio 2005 to 2010
Please help.
LuFFy
8,31310 gold badges38 silver badges59 bronze badges
asked Aug 16, 2011 at 10:01
4
I have had this problem with VS2015 while building locally in Windows.
In order to solve it, I deleted my build folder (Output Directory as seen in Properties/General) and rebuilt the project.
This always seems to help when strange things happen during the build.
answered Aug 2, 2017 at 8:36
AutexAutex
1971 silver badge12 bronze badges
I’ve encountered this error many times in VC++. Do the following steps. They’ve sometimes helped me with this issue:
- Take a look at the exact location, pointed out by compiler error.
- Find any external types or classes used there at that location.
- Change the order of “include path” of those files found in step 2 and rebuild the solution.
- I hope that help !!!!
answered Aug 16, 2011 at 10:17
TonySalimiTonySalimi
8,0944 gold badges31 silver badges62 bronze badges
0
I am getting same error with VC2012. Setting up the project properties Optimization to Disabled (/Od) resolved the issue.
answered Feb 3, 2014 at 12:27
anilanil
9711 gold badge11 silver badges23 bronze badges
2
In my solution, i’ve removed output dll file of the project, and I’ve made project rebuild.
answered Apr 27, 2017 at 16:52
Paweł IwaneczkoPaweł Iwaneczko
8131 gold badge10 silver badges13 bronze badges
I encountered the same error and spent quite a bit of time hunting for the problem. Finally I discovered that function that the error was pointing to had an infinite while loop. Fixed that and the error went away.
answered Mar 7, 2014 at 1:45
quiteProquitePro
5465 silver badges3 bronze badges
In my case was the use of a static lambda function with a QStringList argument. If I commented the regions where the QStringList was used the file compiled, otherwise the compiler reported the C1001 error. Changing the lambda function to non-static solved the problem (obviously other options could have been to use a global function within an anonymous namespace or a static private method of the class).
answered Jan 30, 2017 at 10:57
cbuchartcbuchart
10.4k7 gold badges53 silver badges86 bronze badges
I got this error using boost library with VS2017. Cleaning the solution and rebuilding it, solved the problem.
answered Feb 27, 2018 at 16:06
TidesTides
11111 bronze badges
I also had this problem while upgrading from VS2008 to VS2010.
To fix, I have to install a VS2008 patch (KB976656).
Maybe there is a similar patch for VS2005 ?
answered Jan 9, 2013 at 16:33
I got the same error, but with a different file referenced in the error message, on a VS 2015 / x64 / Win7 build. In my case the file was main.cpp. Fixing it for me was as easy as doing a rebuild all (and finding something else to do while the million plus lines of code got processed).
Update: it turns out the root cause is my hard drive is failing. After other symptoms prompted me to run chkdsk, I discovered that most of the bad sectors that were replaced were in .obj, .pdb, and other compiler-generated files.
answered Sep 6, 2016 at 22:54
hlongmorehlongmore
1,52625 silver badges27 bronze badges
I got this one with code during refactoring with a lack of care (and with templates, it case that was what made an ICE rather than a normal compile time error)
Simplified code:
void myFunction() {
using std::is_same_v;
for (auto i ...) {
myOtherFunction(..., i);
}
}
void myOtherFunction(..., size_t idx) {
// no statement using std::is_same_v;
if constexpr (is_same_v<T, char>) {
...
}
}
answered Nov 27, 2017 at 5:36
chrisb2244chrisb2244
2,91022 silver badges42 bronze badges
I had this error when I was compiling to a x64 target.
Changing to x86 let me compile the program.
answered Oct 17, 2017 at 14:38
Robert AndrzejukRobert Andrzejuk
4,9932 gold badges23 silver badges30 bronze badges
Sometimes helps reordering the code. I had once this error in Visual Studio 2013 and this was only solved by reordering the members of the class (I had an enum member, few strings members and some more enum members of the same enum class. It only compiled after I’ve put the enum members first).
answered Jun 12, 2019 at 13:51
In my case, this was causing the problem:
std::count_if(data.cbegin(), data.cend(), [](const auto& el) { return el.t == t; });
Changing auto to the explicit type fixed the problem.
answered Nov 13, 2019 at 15:06
Had similar problem with Visual Studio 2017 after switching to C++17:
boost/mpl/aux_/preprocessed/plain/full_lambda.hpp(203): fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'msc1.cpp', line 1518)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
Solved by using Visual Studio 2019.
answered Jan 15, 2020 at 12:04
DmytroDmytro
1,25216 silver badges21 bronze badges
I first encountered this problem when i was trying to allocate memory to a char* using new char['size']{'text'}, but removing the braces and the text between them solved my problem (just new char['size'];)
answered Jun 19, 2022 at 16:38
Another fix on Windows 10 if you have WSL installed is to disable LxssManager service and reboot the PC.
answered Aug 21, 2022 at 19:10
Содержание
- Неустранимая ошибка C1001
- Fatal Error C1001
- Fatal error c1001 внутренняя ошибка компилятора
- Asked by:
- Question
- визуальная фатальная ошибка C1001: в компиляторе произошла внутренняя ошибка
- Решение
- Другие решения
- Fatal error c1001 внутренняя ошибка компилятора
- Asked by:
- Question
Неустранимая ошибка C1001
ВНУТРЕННЯЯ ОШИБКА КОМПИЛЯТОРА ( файл компилятора, номер строки)
Компилятор не может создать правильный код для конструкции, часто из-за сочетания определенного выражения и параметра оптимизации или проблемы при анализе. Если указанный файл компилятора содержит сегмент пути в формате UTC или C2, вероятно, это ошибка оптимизации. Если файл содержит сегмент пути cxxfe или c1xx или msc1.cpp, вероятно, это ошибка средства синтаксического анализа. Если файл с именем cl.exe, другие сведения отсутствуют.
Часто можно устранить проблему оптимизации, удалив один или несколько вариантов оптимизации. Чтобы определить, какой вариант неисправен, удаляйте параметры по одному и перекомпилируйте, пока сообщение об ошибке не исчезнет. Чаще всего отвечают параметры /Og (глобальная оптимизация) и /Oi (создание встроенных функций). Определив, какой вариант оптимизации отвечает, вы можете отключить его вокруг функции, в которой возникает ошибка, с помощью директивы optimize pragma и продолжить использовать параметр для остальной части модуля. Дополнительные сведения о параметрах оптимизации см. в разделе Рекомендации по оптимизации.
Если оптимизация не несет ответственности за ошибку, попробуйте переписать строку, в которой сообщается ошибка, или несколько строк кода, окружающих ее. Чтобы просмотреть код так, как компилятор видит его после предварительной обработки, можно использовать параметр /P (Предварительная обработка к файлу).
Дополнительные сведения о том, как изолировать источник ошибки и как сообщить о внутренней ошибке компилятора в корпорацию Майкрософт, см. в статье Как сообщить о проблеме с набором инструментов Visual C++.
Источник
Fatal Error C1001
INTERNAL COMPILER ERROR(compiler file file, line number)
The compiler cannot generate correct code for a construct, often due to the combination of a particular expression and an optimization option, or an issue in parsing. If the compiler file listed has a utc or C2 path segment, it is probably an optimization error. If the file has a cxxfe or c1xx path segment, or is msc1.cpp, it is probably a parser error. If the file named is cl.exe, there is no other information available.
You can often fix an optimization problem by removing one or more optimization options. To determine which option is at fault, remove options one at a time and recompile until the error message goes away. The options most commonly responsible are /Og (Global optimizations) and /Oi (Generate Intrinsic Functions). Once you determine which optimization option is responsible, you can disable it around the function where the error occurs by using the optimize pragma, and continue to use the option for the rest of the module. For more information about optimization options, see Optimization best practices.
If optimizations are not responsible for the error, try rewriting the line where the error is reported, or several lines of code surrounding that line. To see the code the way the compiler sees it after preprocessing, you can use the /P (Preprocess to a file) option.
For more information about how to isolate the source of the error and how to report an internal compiler error to Microsoft, see How to Report a Problem with the Visual C++ Toolset.
Источник
Fatal error c1001 внутренняя ошибка компилятора
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
I recently switched our product over to VS2010 from VS2008. Our solution consists of several native C++ projects and some managed C++ projects that link to those native projects.
The managed C++ projects are compiled with the /clr flag, of course. However, when compiling for x64, one of the files that includes one of the boost mutex headers causes the compiler to spit out the following error:
boost_1_43_0_sdkincludeboostthreadwin32basic_timed_mutex.hpp(158): fatal error C1001: An internal error has occurred in the compiler
I’ve traced down the problem to the following piece of code in basic_timed_mutex.hpp:
When compiling for x86, I see the following warning but everything still compiles:
4>boost_1_43_0_sdkincludeboostthreadwin32basic_timed_mutex.hpp(160): warning C4793: ‘boost::detail::basic_timed_mutex::unlock’ : function compiled as native :
4> Found an intrinsic not supported in managed code
It would see the BOOST_INTERLOCKED_EXCHANGE_ADD macro causes the compiler to barf. Does anybody have any ideas on why this is, or how to fix it?
Источник
визуальная фатальная ошибка C1001: в компиляторе произошла внутренняя ошибка
При компиляции на платформе x64 я получаю следующую ошибку:
Если я изменяю настройки на файл препроцессора (Да), я не получаю никакой ошибки.
О моей среде: обновление Microsoft Visual Studio 2005 до 2010
Решение
Я встречал эту ошибку много раз в VC ++. Сделайте следующие шаги. Они всегда помогали мне с этим вопросом:
- Посмотрите на точное местоположение, на которое указывает ошибка компилятора.
- Найдите любые внешние типы или классы, используемые там в этом месте.
- Измените порядок «include path» этих файлов, найденных на шаге 2, и перестройте решение.
- Надеюсь что поможет .
Другие решения
Я получаю ту же ошибку с VC2012. Настройка свойств проекта Оптимизация на Отключено (/ Od) решила проблему.
У меня была эта проблема с VS2015 при сборке локально в Windows.
Чтобы решить эту проблему, я удалил свою папку сборки (выходной каталог, как показано в разделе «Свойства / Общие») и перестроил проект.
Это всегда помогает, когда во время сборки происходят странные вещи.
В моем решении я удалил выходной файл dll проекта, и я сделал пересборка проекта.
Я столкнулся с той же ошибкой и потратил немало времени на поиски этой проблемы. Наконец, я обнаружил, что та функция, на которую указывает ошибка, имеет бесконечный цикл while. Исправлено, и ошибка исчезла.
В моем случае было использование статической лямбда-функции с QStringList аргумент. Если бы я прокомментировал регионы, где QStringList был использован файл, скомпилированный, иначе компилятор сообщил об ошибке C1001. Изменение лямбда-функции на нестатическое решило проблему (очевидно, другие варианты могли бы использовать глобальную функцию в анонимном пространстве имен или статический закрытый метод класса).
Я получил эту ошибку с помощью библиотеки повышения с VS2017. Очистка решения и восстановление его, решили проблему.
У меня также была эта проблема при обновлении с VS2008 до VS2010.
Чтобы исправить, я должен установить патч VS2008 (KB976656).
Источник
Fatal error c1001 внутренняя ошибка компилятора
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
I recently switched our product over to VS2010 from VS2008. Our solution consists of several native C++ projects and some managed C++ projects that link to those native projects.
The managed C++ projects are compiled with the /clr flag, of course. However, when compiling for x64, one of the files that includes one of the boost mutex headers causes the compiler to spit out the following error:
boost_1_43_0_sdkincludeboostthreadwin32basic_timed_mutex.hpp(158): fatal error C1001: An internal error has occurred in the compiler
I’ve traced down the problem to the following piece of code in basic_timed_mutex.hpp:
When compiling for x86, I see the following warning but everything still compiles:
4>boost_1_43_0_sdkincludeboostthreadwin32basic_timed_mutex.hpp(160): warning C4793: ‘boost::detail::basic_timed_mutex::unlock’ : function compiled as native :
4> Found an intrinsic not supported in managed code
It would see the BOOST_INTERLOCKED_EXCHANGE_ADD macro causes the compiler to barf. Does anybody have any ideas on why this is, or how to fix it?
Источник
При компиляции на платформе x64 я получаю следующую ошибку:
c:codavs05hpsw-scovpacctoolscodaaccesstestcoda_access.cpp(1572): fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:ddvctoolscompilerutcsrcp2sizeopt.c', line 55)
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
------ Build started: Project: asyncexample, Configuration: Release Win32 ------
Если я изменяю настройки на файл препроцессора (Да), я не получаю никакой ошибки.
О моей среде: обновление Microsoft Visual Studio 2005 до 2010
Пожалуйста помоги.
13
Решение
Я встречал эту ошибку много раз в VC ++. Сделайте следующие шаги. Они всегда помогали мне с этим вопросом:
- Посмотрите на точное местоположение, на которое указывает ошибка компилятора.
- Найдите любые внешние типы или классы, используемые там в этом месте.
- Измените порядок «include path» этих файлов, найденных на шаге 2, и перестройте решение.
- Надеюсь что поможет !!!!
9
Другие решения
Я получаю ту же ошибку с VC2012. Настройка свойств проекта Оптимизация на Отключено (/ Od) решила проблему.
7
У меня была эта проблема с VS2015 при сборке локально в Windows.
Чтобы решить эту проблему, я удалил свою папку сборки (выходной каталог, как показано в разделе «Свойства / Общие») и перестроил проект.
Это всегда помогает, когда во время сборки происходят странные вещи.
4
В моем решении я удалил выходной файл dll проекта, и я сделал пересборка проекта.
3
Я столкнулся с той же ошибкой и потратил немало времени на поиски этой проблемы. Наконец, я обнаружил, что та функция, на которую указывает ошибка, имеет бесконечный цикл while. Исправлено, и ошибка исчезла.
2
В моем случае было использование статической лямбда-функции с QStringList аргумент. Если бы я прокомментировал регионы, где QStringList был использован файл, скомпилированный, иначе компилятор сообщил об ошибке C1001. Изменение лямбда-функции на нестатическое решило проблему (очевидно, другие варианты могли бы использовать глобальную функцию в анонимном пространстве имен или статический закрытый метод класса).
2
Я получил эту ошибку с помощью библиотеки повышения с VS2017. Очистка решения и восстановление его, решили проблему.
2
У меня также была эта проблема при обновлении с VS2008 до VS2010.
Чтобы исправить, я должен установить патч VS2008 (KB976656).
Может быть, есть похожий патч для VS2005?
1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
#include "StdAfx.h" #include ".gamemap.h" namespace WorldBase { GameMap::GameMap(void) { _tcscpy_s(m_szSkyBoxTopTex,sizeof(m_szSkyBoxTopTex)/sizeof(TCHAR), _T("")); _tcscpy_s(m_szSkyBoxFrontRightTex,sizeof(m_szSkyBoxFrontRightTex)/sizeof(TCHAR), _T("")); _tcscpy_s(m_szSkyBoxBackLeftTex,sizeof(m_szSkyBoxBackLeftTex)/sizeof(TCHAR), _T("")); } GameMap::~GameMap(void) { Destroy(); } void GameMap::LoadFromFile(IFS* pFS,const TCHAR* szFileName,DWORD options) { m_staticMapObjs.clear(); m_npcs.clear(); m_waypoints.clear(); m_triggers.clear(); m_sounds.clear(); m_PointLight.clear(); m_MapRect.clear(); m_PathPoint.clear(); m_SpawnPoint.clear(); m_DynamicBlock.clear(); m_EventTriggers.clear(); m_MapAreaEx.clear(); m_MapTriggerEffect.clear(); m_MapCloudLayer.clear(); //load header DWORD hFile=pFS->Open(szFileName); THROW_NULLEX(hFile,_T("GameMap open file failed."),szFileName); tagMapHeader header; pFS->Read(&header,sizeof(tagMapHeader),hFile); ASSERT(sizeof(m_Fog)==sizeof(header.byDistFog)); memcpy(&m_Fog,header.byDistFog,sizeof(m_Fog)); ASSERT(sizeof(m_SunLight)==sizeof(header.bySunLight)); memcpy(&m_SunLight,header.bySunLight,sizeof(m_SunLight)); //方向光diffuse乘以强度 m_SunLight.diffuse.R*=header.fSunModulus; m_SunLight.diffuse.G*=header.fSunModulus; m_SunLight.diffuse.B*=header.fSunModulus; _tcscpy_s(m_szSkyBoxTopTex, sizeof(m_szSkyBoxTopTex)/sizeof(TCHAR), header.szSkyBoxTopTex); _tcscpy_s(m_szSkyBoxFrontRightTex, sizeof(m_szSkyBoxFrontRightTex)/sizeof(TCHAR), header.szSkyBoxFrontRightTex); _tcscpy_s(m_szSkyBoxBackLeftTex, sizeof(m_szSkyBoxBackLeftTex)/sizeof(TCHAR), header.szSkyBoxBackLeftTex); m_fSkyBoxXsize = header.fSkyBoxXsize; m_fSkyBoxYsize = header.fSkyBoxYsize; m_fSkyBoxZsize = header.fSkyBoxZsize; m_fSkyBoxOffX = header.fSkyBoxOffX; m_fSkyBoxOffY = header.fSkyBoxOffY; m_fSkyBoxOffZ = header.fSkyBoxOffZ; m_fSunModulus = header.fSunModulus; m_fSkyYaw = header.fSkyYaw; ASSERT(sizeof(m_SkyCol) == sizeof(header.bySkyCol)); memcpy(&m_SkyCol, header.bySkyCol, sizeof(m_SkyCol)); m_bRenderSkyShade = ( 0 != header.byRenderSkyShade ); m_dwSkyShadeCol = header.dwSkyShadeCol; m_dwDynamicDiffCol = header.dwDynamicDiffCol; m_dwDynamicAmbCol = header.dwDynamicAmbCol; m_dwDynamicSpecCol = header.dwDynamicSpecCol; int i; //--load npc if(options&ELO_Npc) { pFS->Seek(hFile,header.dwNpcOffset,FILE_BEGIN); for(i = 0; i < header.nNumNPC; i++) { tagMapNPC npc; pFS->Read(&npc, sizeof(npc),hFile); m_npcs[npc.dwObjID]=npc; } } //load static objs if(options&ELO_Static) { pFS->Seek(hFile,header.dwStaticObjOffset,FILE_BEGIN); for(i=0;i<header.nNumStaticObj;i++) { tagStaticMapObj staticObj; pFS->Read(&staticObj,sizeof(staticObj),hFile); m_staticMapObjs.push_back(staticObj); } } //load waypoint if(options&ELO_WayPoint) { pFS->Seek(hFile,header.dwWayPointOffset,FILE_BEGIN); for(i=0;i<header.nNumWayPoint;i++) { tagMapWayPoint waypoint; pFS->Read(&waypoint,sizeof(waypoint),hFile); m_waypoints.push_back(waypoint); } } //load triggers if(options&ELO_Trigger) { pFS->Seek(hFile,header.dwTriggerOffset,FILE_BEGIN); for(i=0;i<header.nNumTrigger;i++) { tagMapTrigger pTriggerObj; /*pFS->Read(&trigger,sizeof(trigger),hFile);*/ tstring szTemp; FReadValue(pFS, hFile, pTriggerObj.dwObjID); FReadValue(pFS, hFile, pTriggerObj.eType); FReadValVector(pFS, hFile, pTriggerObj.region); FReadValue(pFS, hFile, pTriggerObj.box.max); FReadValue(pFS, hFile, pTriggerObj.box.min); FReadValue(pFS, hFile, pTriggerObj.fHeight); pFS->Read(pTriggerObj.szMapName, sizeof(pTriggerObj.szMapName), hFile); pFS->Read(pTriggerObj.szWayPoint, sizeof(pTriggerObj.szWayPoint), hFile); pFS->Read(pTriggerObj.szScriptName, sizeof(pTriggerObj.szScriptName), hFile); FReadValue(pFS, hFile, pTriggerObj.dwParam); FReadValue(pFS, hFile, pTriggerObj.bLock); FReadValue(pFS, hFile, pTriggerObj.bFlag); FReadValue(pFS, hFile, pTriggerObj.dwQuestSerial); pFS->Read(pTriggerObj.byReserve, sizeof(pTriggerObj.byReserve), hFile); m_triggers.push_back(pTriggerObj); } } //load sound if(options&ELO_Sound) { pFS->Seek(hFile,header.dwSoundOffset,FILE_BEGIN); for(i=0;i<header.nNumSound;i++) { tagMapSound sound; pFS->Read(&sound,sizeof(sound),hFile); m_sounds.push_back(sound); } } //load pointlight if(options&ELO_PointLight) { pFS->Seek(hFile,header.dwPointLightOffset,FILE_BEGIN); for(i=0;i<header.nNumPointLight;i++) { tagMapPointLight pointlight; pFS->Read(&pointlight,sizeof(pointlight),hFile); m_PointLight.push_back(pointlight); } } //load maprect by add xtian 2008-5-13 if(options&ELO_MapRect) { pFS->Seek(hFile, header.dwMapRectOffset, FILE_BEGIN); for(i=0; i<header.nNumMapRect; i++) { tagMapArea mapRect; /*pFS->Read(&maprect, sizeof(maprect), hFile);*/ FReadValue(pFS, hFile, mapRect.dwObjID); FReadValue(pFS, hFile, mapRect.eType); FReadValVector(pFS, hFile, mapRect.region); FReadValue(pFS, hFile, mapRect.box.max); FReadValue(pFS, hFile, mapRect.box.min); FReadValue(pFS, hFile, mapRect.fHeight); FReadValue(pFS, hFile, mapRect.bLock); FReadValue(pFS, hFile, mapRect.bFlag); FReadValue(pFS, hFile, mapRect.dwMiniMapSize); FReadValue(pFS, hFile, mapRect.bDistFog); pFS->Read(mapRect.byDistFog, sizeof(mapRect.byDistFog), hFile); pFS->Read(mapRect.byReserve, sizeof(mapRect.byReserve), hFile); m_MapRect.push_back(mapRect); } //--额外信息 XMLReader varAreaEx; Filename mbPath = szFileName; TCHAR szMapAreaExPath[256]; _stprintf( szMapAreaExPath, _T("%smaparea.xml"), mbPath.GetPath().c_str() ); list<tstring> ExFieldList; list<tstring>::iterator iter; if(varAreaEx.Load(pFS, szMapAreaExPath, "id", &ExFieldList)) { for(iter = ExFieldList.begin(); iter != ExFieldList.end(); ++iter) { tagMapAreaEx areaEx; areaEx.dwObjID = varAreaEx.GetDword(_T("id"), (*iter).c_str(), -1); areaEx.strTitle = varAreaEx.GetString(_T("title"), (*iter).c_str(), _T("")); areaEx.wInterval = (WORD)varAreaEx.GetDword(_T("interval"), (*iter).c_str(), 0); areaEx.byVol = (BYTE)varAreaEx.GetDword(_T("volume"), (*iter).c_str(), 100); areaEx.byPriority = (BYTE)varAreaEx.GetDword(_T("priority"), (*iter).c_str(), 1); for( int musici=0; musici<3; ++musici ) { TCHAR szBuff[32]; _stprintf( szBuff, _T("music%d"), musici ); areaEx.strMusic[musici] = varAreaEx.GetString(szBuff, (*iter).c_str(), _T("")); } m_MapAreaEx.insert(make_pair(areaEx.dwObjID,areaEx)); } } } //load pathpoint by add xtian 2008-8-6 if(options&ELO_PathPoint) { pFS->Seek(hFile, header.dwPathPointOffset, FILE_BEGIN); for(int i=0; i<header.nNumPathPoint; i++) { tagMapPathPoint pathpoint; pFS->Read(&pathpoint, sizeof(tagMapPathPoint), hFile); m_PathPoint.push_back(pathpoint); } } //load spawnpoint by add xtian 2008-8-11 if(options&ELO_SpawnPoint) { pFS->Seek(hFile, header.dwSpawnPointOffset, FILE_BEGIN); for(int i=0; i<header.nNumSpawnPoint; i++) { tagMapSpawnPoint spawnpoint; pFS->Read(&spawnpoint, sizeof(tagMapSpawnPoint), hFile); m_SpawnPoint.push_back(spawnpoint); } } //load dynamicblock by add xtian 2008-8-11 if(options&ELO_DynamicBlock) { pFS->Seek(hFile, header.dwDynamicBlockOffset, FILE_BEGIN); for(int i=0; i<header.nNumDynamicBlock; i++) { tagMapDynamicBlock dynaBlock; pFS->Read(&dynaBlock, sizeof(tagMapDynamicBlock), hFile); m_DynamicBlock.push_back(dynaBlock); } } if(options&ELO_EventTrigger) { pFS->Seek(hFile, header.dwEventTriggerOffset, FILE_BEGIN); for(int i=0; i<header.nNumEventTrigger; i++) { tagMapEventTrigger eventTrigger; pFS->Read(&eventTrigger, sizeof(tagMapEventTrigger), hFile); m_EventTriggers.push_back(eventTrigger); } } if(options&ELO_MapDoor) { pFS->Seek(hFile, header.dwMapDoorOffset, FILE_BEGIN); for(int i=0; i<header.nNumMapDoor; i++) { tagMapDoor door; pFS->Read(&door, sizeof(tagMapDoor), hFile); m_MapDoor.push_back(door); } } if(options&ELO_MapCarrier) { pFS->Seek(hFile, header.dwMapCarrierOffset, FILE_BEGIN); for(int i=0; i<header.nNumMapCarrier; i++) { tagMapCarrier carrier; pFS->Read(&carrier, sizeof(tagMapCarrier), hFile); m_MapCarrier.push_back(carrier); } } if(options&ELO_MapTriggerEffect) { pFS->Seek(hFile,header.dwMapTriggerEffectOffset,FILE_BEGIN); for(i=0;i<header.nNumMapTriggerEffect;i++) { tagMapTriggerEffect obj; pFS->Read(&obj,sizeof(obj),hFile); m_MapTriggerEffect.push_back(obj); } } if(options&ELO_MapCloudLayer) { pFS->Seek(hFile,header.dwCloudLayerOffset, FILE_BEGIN); for(i = 0; i<header.nNumCloudLayer; ++i) { tagMapCloudLayer cld; pFS->Read(&cld, sizeof(cld), hFile); m_MapCloudLayer.push_back(cld); } } //--close file pFS->Close(hFile); } void GameMap::Destroy() { } /*const tagDynamicMapObj* GameMap:: FindDynamicMapObj(DWORD mapID) { map<DWORD, tagDynamicMapObj>::iterator pIter = m_dynamicMapObjs.find(mapID); if(pIter != m_dynamicMapObjs.end()) return &pIter->second; return NULL; }*/ const tagMapNPC* GameMap:: FindMapNpc(DWORD mapID) { map<DWORD, tagMapNPC>::iterator pIter = m_npcs.find(mapID); if(pIter != m_npcs.end()) return &pIter->second; return NULL; } const tagStaticMapObj* GameMap::FindStaticMapObj(DWORD mapID) { vector<tagStaticMapObj>::iterator pIter = m_staticMapObjs.begin(); for(; pIter != m_staticMapObjs.end(); ++pIter) if(mapID == (*pIter).dwMapID) return &(*pIter); return NULL; } const tagMapAreaEx* GameMap::FindMapAreaEx( DWORD areaID ) { map<DWORD, tagMapAreaEx>::iterator pIter = m_MapAreaEx.find(areaID); if(pIter != m_MapAreaEx.end()) return &pIter->second; return NULL; } bool GameMap::GetMapAreaFog( const int nAreaIndex, tagDistFog& fog ) { ASSERT( nAreaIndex >=0 && nAreaIndex < (int)m_MapRect.size() ); tagMapArea& area = m_MapRect[nAreaIndex]; if( !area.bDistFog ) return false; ASSERT( sizeof(fog) == sizeof(area.byDistFog) ); memcpy( &fog, area.byDistFog, sizeof(fog) ); return true; } }//namespace WorldBase |
