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,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
Iam getting the following error , could some one help me how to fix it .
fatal error C1001: INTERNAL COMPILER
ERROR (compiler file
‘f:vs70builds3077vcCompilerCxxFEslP1Cpdbmgr.cpp’,
line 149) Please choose the Technical
Support command on the Visual C++
Help menu, or open the Technical
Support help file for more information
brickner
6,5853 gold badges41 silver badges54 bronze badges
asked Jul 7, 2009 at 10:57
4
INTERNAL COMPILER ERROR(compiler file file, line number)
The compiler cannot generate correct code for a construct, probably due to the combination of an expression and an optimization option. Try removing one or more optimization options and recompiling the function containing the line indicated in the error message.
You can probably fix the 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, /Oi, and /Oa. Once you determine which option is responsible, you can disable it using the optimize pragma around the function where the error occurs and continue to use the option for the rest of the module.
The Microsoft Knowledge Base has more information about C1001; see http://support.microsoft.com/default.aspx?scid=kb;en-us;134650.
answered Apr 16, 2015 at 11:31
Nope, you’re screwed. You’ve done something that exposed an error in the compiler. Play with optimization settings, #pragmas and fiddling with your code until it works.
And perhaps submit a bug report on connect.microsoft.com
answered Jul 7, 2009 at 11:05
jalfjalf
242k51 gold badges343 silver badges549 bronze badges
That’s a very unfortunate thing. Such indications appear once in a while for no apparent reason. Even MSDN recommends to go to the code and play with optimization pragmas there. You have to detect what construct causes this indication and rewrite it somehow. Or you can use a newer version of VC++.
answered Jul 7, 2009 at 11:00
sharptoothsharptooth
167k100 gold badges510 silver badges969 bronze badges
При попытке скомпилировать код на языке c ++, включая библиотеки API sfml, возникает следующая ошибка:
Внутренняя ошибка компилятора в C: Program Files (x86) Microsoft Visual Studio 2017 Community VC Tools MSVC 14.10.25017 bin HostX86 x86 CL.exe ‘
Выберите команду технической поддержки в меню справки Visual C ++ или откройте файл справочной службы для получения дополнительной информации.
C: Program Files (x86) Microsoft Visual Studio 2017 Community Common7 IDE VC VCTargets Microsoft.CppCommon.targets (358,5): ошибка MSB6006: «CL.exe» завершен с кодом 2.
Я искал в Интернете решение для этого, но я не мог решить это …
Когда я попросил помощи на форуме visual studio, я получил единственный ответ:
«Спасибо за ваш отзыв! Эта проблема была исправлена, и она будет доступна в следующем обновлении Visual Studio 2017. Спасибо за помощь в создании лучшей Visual Studio! »
Вот код с ошибкой:
#include <SFMLGraphics.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(640, 480), "Bouncing Mushroom");
sf::Texture mushroomTexture;
mushroomTexture.loadFromFile("mushroom.png");
sf::Sprite mushroom(mushroomTexture);
sf::Vector2u size = mushroomTexture.getSize;
mushroom.setOrigin(size.x / 2, size.y / 2);
sf::Vector2f increment(0.4f, 0.4f);
while (window.isOpen())
{
sf::Event evnt;
while (window.pollEvent(evnt))
{
if (evnt.type == sf::Event::Closed)
window.close();
}
if ((mushroom.getPosition().x + (size.x / 2) > window.getSize().x && increment.x > 0) || (mushroom.getPosition().x - (size.x / 2) < 0 && increment.x < 0))
{
// Reverse the direction on X axis.
increment.x = -increment.x;
}
if ((mushroom.getPosition().y + (size.y / 2) > window.getSize().y && increment.y > 0) || (mushroom.getPosition().y - (size.y / 2) < 0 && increment.y < 0))
{
// Reverse the direction on Y axis.
increment.y = -increment.y;
}
mushroom.setPosition(mushroom.getPosition() + increment);
window.clear(sf::Color(16, 16, 16, 255)); // Dark gray.
window.draw(mushroom); // Drawing our sprite.
window.display();
}
0
Решение
Хорошо, если это буквально код, который вы пытаетесь скомпилировать, есть две синтаксические ошибки:
1.- В строке 10
mushroomTexture.getSize;
getSize — это метод из класса sf :: Texture, не являющийся членом, поэтому просто добавьте ();
mushroomTexture.getSize();
2.- В конце основной функции отсутствует «}». (Я думаю, что вы просто не скопировали это правильно, но все равно проверьте это.
window.display();
}
} <---- end of main() missing
Если это не решило вашу проблему, возможно, у вас неправильные SFML-файлы для вашей версии VS, если вы используете VS 2017, загрузите Visual C ++ 14 (2015) — 32-разрядная версия версия https://www.sfml-dev.org/download/sfml/2.4.2/ это работает для VS 2015 & 2017 (я использовал его на VS 2017, чтобы проверить ваш пример, и он запустился без проблем).
0
Другие решения
Внутренние ошибки компилятора обычно означают, что с компилятором что-то не так, и, видя, что это VS 2017, я не удивлюсь, если это будет ошибка, так как это более новая версия VS. Тем временем вы можете попытаться найти строку кода, которая вызывает эту ошибку, и найти альтернативное решение или использовать более старую версию Visual Studio.
1
Я скачал Visual Studio 2015 и попытался запустить код в нем (все учебные пособия по sfml сделаны в версии 2015) и запустить код.
Я считаю, что проблема в том, что библиотеки sfml еще не совместимы с vs 2017, поэтому решение простое:
-использовать Visual Studio 2015 или
-перекомпилировать библиотеки для Visual Studio 2017 (я не знаю, как это сделать)
0
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
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
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,33110 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,1044 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
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.5k7 gold badges53 silver badges87 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,53525 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 badges43 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
При попытке скомпилировать код на языке c ++, включая библиотеки API sfml, возникает следующая ошибка:
Внутренняя ошибка компилятора в C: Program Files (x86) Microsoft Visual Studio 2017 Community VC Tools MSVC 14.10.25017 bin HostX86 x86 CL.exe ‘
Выберите команду технической поддержки в меню справки Visual C ++ или откройте файл справочной службы для получения дополнительной информации.
C: Program Files (x86) Microsoft Visual Studio 2017 Community Common7 IDE VC VCTargets Microsoft.CppCommon.targets (358,5): ошибка MSB6006: «CL.exe» завершен с кодом 2.
Я искал в Интернете решение для этого, но я не мог решить это …
Когда я попросил помощи на форуме visual studio, я получил единственный ответ:
«Спасибо за ваш отзыв! Эта проблема была исправлена, и она будет доступна в следующем обновлении Visual Studio 2017. Спасибо за помощь в создании лучшей Visual Studio! »
Вот код с ошибкой:
#include <SFMLGraphics.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(640, 480), "Bouncing Mushroom");
sf::Texture mushroomTexture;
mushroomTexture.loadFromFile("mushroom.png");
sf::Sprite mushroom(mushroomTexture);
sf::Vector2u size = mushroomTexture.getSize;
mushroom.setOrigin(size.x / 2, size.y / 2);
sf::Vector2f increment(0.4f, 0.4f);
while (window.isOpen())
{
sf::Event evnt;
while (window.pollEvent(evnt))
{
if (evnt.type == sf::Event::Closed)
window.close();
}
if ((mushroom.getPosition().x + (size.x / 2) > window.getSize().x && increment.x > 0) || (mushroom.getPosition().x - (size.x / 2) < 0 && increment.x < 0))
{
// Reverse the direction on X axis.
increment.x = -increment.x;
}
if ((mushroom.getPosition().y + (size.y / 2) > window.getSize().y && increment.y > 0) || (mushroom.getPosition().y - (size.y / 2) < 0 && increment.y < 0))
{
// Reverse the direction on Y axis.
increment.y = -increment.y;
}
mushroom.setPosition(mushroom.getPosition() + increment);
window.clear(sf::Color(16, 16, 16, 255)); // Dark gray.
window.draw(mushroom); // Drawing our sprite.
window.display();
}
0
Решение
Хорошо, если это буквально код, который вы пытаетесь скомпилировать, есть две синтаксические ошибки:
1.- В строке 10
mushroomTexture.getSize;
getSize — это метод из класса sf :: Texture, не являющийся членом, поэтому просто добавьте ();
mushroomTexture.getSize();
2.- В конце основной функции отсутствует «}». (Я думаю, что вы просто не скопировали это правильно, но все равно проверьте это.
window.display();
}
} <---- end of main() missing
Если это не решило вашу проблему, возможно, у вас неправильные SFML-файлы для вашей версии VS, если вы используете VS 2017, загрузите Visual C ++ 14 (2015) — 32-разрядная версия версия https://www.sfml-dev.org/download/sfml/2.4.2/ это работает для VS 2015 & 2017 (я использовал его на VS 2017, чтобы проверить ваш пример, и он запустился без проблем).
0
Другие решения
Внутренние ошибки компилятора обычно означают, что с компилятором что-то не так, и, видя, что это VS 2017, я не удивлюсь, если это будет ошибка, так как это более новая версия VS. Тем временем вы можете попытаться найти строку кода, которая вызывает эту ошибку, и найти альтернативное решение или использовать более старую версию Visual Studio.
1
Я скачал Visual Studio 2015 и попытался запустить код в нем (все учебные пособия по sfml сделаны в версии 2015) и запустить код.
Я считаю, что проблема в том, что библиотеки sfml еще не совместимы с vs 2017, поэтому решение простое:
-использовать Visual Studio 2015 или
-перекомпилировать библиотеки для Visual Studio 2017 (я не знаю, как это сделать)
0
Вопрос:
Я обновился до версии Visual Studio 2015 Update 1, но теперь я получаю следующую ошибку, когда когда-либо компилирую конфигурацию выпуска для 64-битного, все работает для 32-битных и/или отладочных сборников.
fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:ddvctoolscompilerutcsrcp2main.c', line 246)
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
link!InvokeCompilerPass()+0x2d4bd
link!DllGetC2Telemetry()+0xae663
Ошибка возникает не для каждого из моих проектов, а для некоторых.
Упрощение указанного местоположения на самом деле невозможно, место, где происходит сбой компилятора, обычно является просто простой функцией одной строки, также изменение этого кода приводит к той же ошибке в другом месте. Насколько я могу предположить, он должен что-то сделать с оптимизацией и вложением. Но изменение параметров оптимизации тоже не помогло.
Может ли кто-нибудь указать мне, как найти реальный проблемный код или некоторые параметры компилятора, чтобы избежать этой ошибки?
Я не хотел бы думать, что обновление не работает.
Лучший ответ:
Мы столкнулись с C1001 в одном из наших проектов после обновления до обновления MSVC 2015.
Через пробную ошибку мы идентифицировали свойство ClCompile/AssemblerOutput
как виновника в нашем случае. Удаление этого свойства больше не вызвало C1001
Источник: https://trac.osgeo.org/mapguide/ticket/2580
Обновление 6 апреля 2016 года: я попытался создать этот же проект с обновлением MSVC 2015 Update 2 без свойства ClCompile/AssemblerOutput
, и я больше не получаю C1001 при создании этого проекта. Я думаю, что обновление 2 исправлено.
Ответ №1
Попробуйте настроить при оптимизации проекта на Disabled (/Od), это может решить проблему.
Чтобы установить этот параметр компилятора в Visual Studio среда
- Откройте диалоговое окно “Страницы свойств проекта”.
- Щелкните папку C/С++.
- Перейдите на страницу свойств оптимизации.
- Измените свойство Оптимизация.
Источник: https://msdn.microsoft.com/en-us/library/aafb762y.aspx
Я надеюсь, что мой ответ будет поддерживать вашу проблему.
Ответ №2
Repro компилирует JSON lib в Release | x64. Конфигурация была установлена на максимальной скорости (/O2), но General использовал “Нет оптимизации всей программы”.
Переход от “Нет оптимизации всей программы” для использования генерации кода времени ссылки (я считаю, что флаг является /LTCG ) успешно завершен.
Ответ №3
Я также столкнулся с этой проблемой, пока мы конвертировали нашу кодовую базу компании с VC10 на VC14. В нашем случае проблема возникла, когда таргетинг на x64 и SEH (/EHa
) был включен одновременно с выходом Ассемблера. Ошибка произошла в нашем случае, когда в скомпилированном коде был вызван оператор ввода потока (т.е. std::cout::operator<<
).
В нашем случае динамическая привязка ЭЛТ вместо статической привязки (т.е. /MT
вместо /MD
), по-видимому, обойти проблему без отключения выхода ассемблера. Это не первая проблема, которую я нашел со статически связанным CRT (например, это также вызвало отсутствующие курсоры при изменении размеров окон CPane в MFC).
Об этом сообщили Microsoft (https://connect.microsoft.com/VisualStudio/feedback/details/2216490/compiler-crashes-at-string-stream-insertion-operator), но через два с половиной месяца оказалось, что они даже не выглядели на нем…
Изменить: VS2015 Update 2, согласно Micrsoft, исправил эту проблему. Он протестирован как исправленный на нашей кодовой базе.
- Проблема
- Решения
- Использование макроса ‘PVS_STUDIO’
- Использование рабочей версии компилятора
Несколько раз нам писали пользователи, у которых перестал работать анализ части проектов. Общей особенностью было использование директивы ‘#import’ в проблемных файлах. В данной заметке будет кратно описано, с чем связана проблема, и что делать для возобновления работы анализа.
Примечание. Данная заметка актуальна только для Windows при использовании компилятора ‘cl.exe’ для препроцессирования.
Проблема
Для поиска ошибок в коде, написанном на языках C, C++, PVS-Studio использует препроцессированные файлы. Для их получения анализатор полагается на сторонние инструменты, в частности – на компилятор cl.exe. Для указания необходимости генерации препроцессированных файлов для cl.exe используется флаг ‘/P’.
Проблема заключается в том, что, начиная с версии Visual Studio 15.8 (и соответствующей версии Visual C++ — VC++ 2017 version 15.8 v14.15 toolset), при запуске cl.exe с флагом ‘/P’ на файлах, содержащих директиву ‘#import’, в компиляторе возникает ошибка.
При этом сборка (когда компилятору не передаётся флаг ‘/P’) проходит успешно. Со стороны это может выглядеть примерно так: проект успешно собирается, но анализатор PVS-Studio не работает. Вывод анализатора на проблемных файлах будет примерно следующим:
c:program files (x86)microsoft visual
studio2017communityvctoolsmsvc14.16.27023includecomdef.h:
fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'msc1.cpp', line 1518)
Internal Compiler Error in c:program files (x86)microsoft visual
studio2017communityvctoolsmsvc14.16.27023binhostx64x64cl.exe
Если вы столкнулись с такой проблемой, скорее всего, ваш проект использует Platform Toolset V141, и проблема возникла после обновления Visual Studio и соответствующих пакетов Visual C++ (и компилятора, соответственно) на более свежую версию. В итоге сборка проекта всё также проходит успешно, а вот анализ – нет.
Чтобы убедиться, что проблема действительно в компиляторе, можете попробовать выставить в настройках соответствующего проекта флаг ‘/P’ и выполнить сборку. Выставление флага: Properties|C/C++|Preprocessor|Preprocess to a File -> Yes(/P).
Кстати, про эту проблему есть отдельная тема на форуме Visual Studio: https://developercommunity.visualstudio.com/content/problem/313306/vs2017-158-internal-compiler-error-msc1cpp-line-15-1.html
Решения
К сожалению, описанная проблема до сих пор актуальна, и будет исправлена, скорее всего, только в следующем релизе Visual Studio. Однако, вы можете продолжать использовать PVS-Studio для проверки проектов, затронутых данной проблемой, с помощью небольшого workaround’а.
Использование макроса ‘PVS_STUDIO’
При вызове компилятора для препроцессирования анализатором задаётся дополнительный макрос – ‘PVS_STUDIO’. Используя этот макрос, вы можете обернуть проблемные строки кода директивой #ifdef — это позволит игнорировать их препроцессору, но при этом не затронет компиляцию кода. Как минимум, следует обернуть саму директиву ‘#import’:
#if !defined(PVS_STUDIO)
#import
...
#endif
Обратите внимание, что в таком случае обёрнутая в директиву часть кода не попадёт в результирующие препроцессированные файлы. В большинстве случаев данная правка не должна повлиять на результаты анализа.
Использование рабочей версии компилятора
Примечание. Данная проблема была решена в версии компилятора в составе Visual Studio (2017) 15.9.14.
Вы можете откатиться на более старую версию компилятора (или более новую), в которой описанной выше проблемы нет (напоминаю, она появилась, начиная с VC++ 2017 Version 15.8 v14.15 toolset).
Заметьте, что Visual Studio 2017 позволяет устанавливать на систему несколько экземпляров Platform Toolset V141, что позволит, при желании, не уменьшать версию Platform Toolset в проекте.
Указать необходимые для использования версии компилятора можно в файлах <VsInstanceDir>VCAuxiliaryBuildMicrosoft.VCToolsVersion.default.[txt|props], где <VsInstanceDir> — установочная директория конкретного выпуска Visual Studio.
Присылаем лучшие статьи раз в месяц