Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

"All compiler errors must be fixed before pressing play" but I have none?!

Discussion in 'Editor & General Support' started by jerotas, Mar 21, 2017.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I have no idea what's going on. I recently took a Unity 4.6 project and opened it with Unity 5.5.2 - the latest version. I got about 300 compiler errors and fixed them all.

    But still when I press play it tells me to fix all compiler errors before I'm able to "play" - however the Console window shows 0 errors. How do I fix this? Seems like a Unity bug of some sort. You can see my Console window below. Please let me know how to resume working on this game!

    I already googled and found no one having similar issues that knows how to program and read the Console window.

    Yes, I've restarted Unity a couple times already and had this same problem with the project on 2 different computers.

    console.PNG
     
    Last edited: Mar 21, 2017
  2. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    It's most likely code hidden behind an #if, such as platform-specific code. So you wouldn't see the compile error except when in those circumstances. For example, I've had errors like that when making builds, where the problem code was in an #if UNITY_EDITOR #else blah
     
  3. Kragh

    Kragh

    Joined:
    Jan 22, 2008
    Posts:
    657
    Open the log file. You probably have such a long list of warnings, it is capped. I had this problem once, and found an actual compile error way down the list in the log file. I don't remember the precise solution, sorry (a year ago), just remember I found it in the editor log file, or something like that
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If so, great. I only have about 500 of those...could take forever to find out if that's what it is.

    Thanks, will report back if I can find something. Still - if this is true, this sounds like a Unity bug. The conditional code that "isn't true" should not be checked for compilation ever unless the condition is satisfied. I remember many times switching platform and only then getting compile errors because of the conditional compilation directives having bad code. That's how it's supposed to work!
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'll take a look, thanks!