Quantcast
Channel: Answers for "Another Internal Compiler Error"
Viewing all articles
Browse latest Browse all 6

Answer by Venryx

$
0
0
I've been having internal compiler errors in my project also, and there are a couple things I've found that could help. First, there is a technique which works well for narrowing-down where the internal compiler error happens. First the thought process: A) I noticed that compiler errors showing up in Visual Studio, when I attempted to build the project there (which failed because Unity hadn't built the DLL file, btw), were not showing up in the Unity console/error log. B) This made me realize that the internal compiler error must be happening at some specific line in some specific file, and that once it hit that line, it stopped compiling the rest of the files. (and thus it never noticed the normal code issues (e.g. "int i = 0 / 0;") that Visual Studio picked up) C) I looked into the Unity Editor logs, and noticed that the files were all being sent to the compiler in alphabetical order--in other words, in basically the same order you see them in the Project view. (the one difference being how they handle capital letters--Unity and Visual Studio consider 'a' to be before 'B', whereas the compiler considers 'a' to be after 'B', since 'B' is capitalized, and it always puts capitalized letters first (presumably because capitalized letters come first in the character map)) D) I realized that I could find which file the 'internal compiler error' happened in by intentionally creating normal compile errors at the bottom of each file, in turn, until I saw the normal error not show up in the Console. (indicating that it came after the internal-compiler-error-causing line) So now: Tip #1) The technique. If you get an 'internal compiler error': 1) Place the following code at the very bottom of the first (alphabetically speaking) script file: (in other words, the top-most script file in the Project view) class CompileBreaker { int i = 0 / 0; } 2) If you still get the 'internal compiler error', then the issue is somewhere in the file. (you can try placing the CompileBreaker at the top, just to make sure) If not, then remove the CompileBreaker code from the file, and add it to the bottom of the next file. 3) Repeating steps 1 and 2 for each script file, in alphabetical order. The first time I used this technique, (which was just a few minutes ago), I was pretty lucky. I found the cause of my 'internal compiler error' in the second file, "Core.cs". Which brings me to my next point, which is that... Tip #2) The Mono compiler for Unity apparently has an issue with partial classes. Here is the file I found to have caused the internal compiler error, with the error-causing line marked: using System; namespace ManagedLzma.LZMA.Master { public static partial class LZMA //

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images