开发者

Why might the "fatal error C1075" error occur intermittently when using msbuild?

开发者 https://www.devze.com 2023-01-28 23:19 出处:网络
Possibly related to my other question (note: different error code): Why might the “fatal error C1001” error occur intermittently when using msbuild?

Possibly related to my other question (note: different error code):

  • Why might the “fatal error C1001” error occur intermittently when using msbuild?

Our buildbot slave compiles our source code nightly and works most of the time, but intermittently, we see this error:

c:\Program Files\Microsoft Visual Studio 9.0\VC\include\xtree(223) : fatal error C1075: end of file found before the left brace '{' at '..\lib\net\CSocketMultiplexer.cpp(62)' was matched
        c:\Program Files\Microsoft Visual Studio 9.0\VC\include\xtree(427) : see reference to class template instantiation 'std::_Tree<_Traits>::const_iterator' being compiled
        with
        [
            _Traits=std::_Tmap_traits<ISocket *,CSocketMultiplexer::CJobCursor,std::less<ISocket *>,std::allocator<std::pair<ISocket *const ,CSock开发者_StackOverflow社区etMultiplexer::CJobCursor>>,false>
        ]
        ..\lib\net\CSocketMultiplexer.cpp(75) : see reference to class template instantiation 'std::_Tree<_Traits>::iterator' being compiled
        with
        [
            _Traits=std::_Tmap_traits<ISocket *,CSocketMultiplexer::CJobCursor,std::less<ISocket *>,std::allocator<std::pair<ISocket *const ,CSocketMultiplexer::CJobCursor>>,false>
        ]

See the full log output and CSocketMultiplexer.cpp -- Is there anything that I can change in CSocketMultiplexer.cpp that might stop this from happening in future?

Also, probably not worth mentioning, but later on in the log, we see this error (which makes total sense, since the file wasn't compiled):

Copyright (C) Microsoft Corporation. All rights reserved.
BSCMAKE: error BK1506 : cannot open file '.\synergy.dir\Debug\CSocketMultiplexer.sbr': No such file or directory


Judging by this and your other question, I'm starting to put my money on "hardware failure". Could be that one bit in one of your RAM chips is faulty, so if you just happen to hit this very byte, a '}' will turn into something else. I'd run a RAM test tool.

Does this machine exhibit other weird behavior? Rare random crashes, for example?


I had the same problem.

The compilation errors were:

*main.cpp(325): error C2601: 'FLAG' : local function definitions are illegal

main.cpp(323): this line contains a '{' which has not yet been matched

main.cpp(326): fatal error C1075: end of file found before the left brace '{' at 'main.cpp(323)' was matched*

But there was nothing wrong with my code. I counted all brackets and the number matched. There weren't any function inside another function.

I solved it by removing all "//" comments from the source code. It seems that the reason for that is bad line formatting which causes the compiler to miss a line break, so the line after a comment is treated as a comment as well.

For example:

// This is a comment

This_is_a_line;

is treated as:

// This is a comment This_is_a_line;
0

精彩评论

暂无评论...
验证码 换一张
取 消