mxgmn / WaveFunctionCollapse

Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics
Other
23.18k stars 1.24k forks source link

Cannot compile on MacOS #39

Closed chrisabbott closed 6 years ago

chrisabbott commented 6 years ago

Hey, I'm running into some issues compiling this using mcs on MacOS High Sierra. Specifically, here's my terminal output after running mcs -pkg:dotnet /reference:System.Drawing.dll *.cs and installing mono using brew. I'm not at all familiar with C# or .NET, so any guidance with this would be appreciated ... it definitely looks like a versioning issue.

Here's my mono version:

Mono JIT compiler version 5.10.1.47 (2017-12/8eb8f7d5e74 Fri Apr 13 20:18:12 EDT 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    Interpreter:   yes
    LLVM:          yes(3.6.0svn-mono-master/8b1520c8aae)
    GC:            sgen (concurrent by default)

And here's my output:

OverlappingModel.cs(50,17): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
OverlappingModel.cs(50,28): error CS1525: Unexpected symbol `int', expecting `,', `;', or `='
OverlappingModel.cs(50,33): error CS1525: Unexpected symbol `byte', expecting `,', `;', or `='
OverlappingModel.cs(55,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(70,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(92,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(97,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
OverlappingModel.cs(97,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(97,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
OverlappingModel.cs(97,44): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
OverlappingModel.cs(97,50): error CS1519: Unexpected symbol `-' in class, struct, or interface member declaration
OverlappingModel.cs(97,54): error CS1519: Unexpected symbol `+' in class, struct, or interface member declaration
OverlappingModel.cs(97,62): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
OverlappingModel.cs(97,76): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(97,83): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
OverlappingModel.cs(97,106): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
OverlappingModel.cs(97,112): error CS1519: Unexpected symbol `-' in class, struct, or interface member declaration
OverlappingModel.cs(97,116): error CS1519: Unexpected symbol `+' in class, struct, or interface member declaration
OverlappingModel.cs(97,124): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
OverlappingModel.cs(98,4): error CS9010: Primary constructor body is not allowed
OverlappingModel.cs(122,5): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(122,20): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(123,15): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(123,25): error CS1519: Unexpected symbol `+' in class, struct, or interface member declaration
OverlappingModel.cs(123,28): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
OverlappingModel.cs(123,33): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(124,12): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(124,23): error CS1519: Unexpected symbol `T' in class, struct, or interface member declaration
OverlappingModel.cs(124,24): error CS1519: Unexpected symbol `]' in class, struct, or interface member declaration
OverlappingModel.cs(124,25): error CS1525: Unexpected symbol `]', expecting `,' or `]'
OverlappingModel.cs(125,16): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(125,29): error CS1519: Unexpected symbol `T' in class, struct, or interface member declaration
OverlappingModel.cs(125,30): error CS1519: Unexpected symbol `]' in class, struct, or interface member declaration
OverlappingModel.cs(128,9): error CS1519: Unexpected symbol `foreach' in class, struct, or interface member declaration
OverlappingModel.cs(128,20): error CS1519: Unexpected symbol `in' in class, struct, or interface member declaration
OverlappingModel.cs(128,30): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
OverlappingModel.cs(129,3): error CS9010: Primary constructor body is not allowed
OverlappingModel.cs(129,3): error CS8041: Primary constructor already has a body
OverlappingModel.cs(140,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(142,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(142,24): error CS1519: Unexpected symbol `4' in class, struct, or interface member declaration
OverlappingModel.cs(142,26): error CS1525: Unexpected symbol `]', expecting `,' or `]'
OverlappingModel.cs(142,28): error CS1525: Unexpected symbol `]', expecting `,' or `]'
OverlappingModel.cs(143,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(143,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
OverlappingModel.cs(143,28): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
OverlappingModel.cs(144,3): error CS9010: Primary constructor body is not allowed
OverlappingModel.cs(144,3): error CS8041: Primary constructor already has a body
OverlappingModel.cs(156,20): error CS1525: Unexpected symbol `bool', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
SimpleTiledModel.cs(40,15): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
SimpleTiledModel.cs(40,26): error CS1525: Unexpected symbol `int', expecting `,', `;', or `='
SimpleTiledModel.cs(40,36): error CS1525: Unexpected symbol `>', expecting `,', `;', or `='
SimpleTiledModel.cs(45,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(49,9): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(49,28): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(49,29): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
SimpleTiledModel.cs(50,13): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(50,31): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(50,32): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,9): error CS1519: Unexpected symbol `foreach' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,28): error CS1519: Unexpected symbol `in' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,43): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,50): error CS1519: Unexpected symbol `tiles' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,63): error CS1525: Unexpected symbol `tile'
SimpleTiledModel.cs(56,53): error CS1520: Class, struct, or interface method must have a return type
SimpleTiledModel.cs(56,68): error CS1525: Unexpected symbol `)'
SimpleTiledModel.cs(143,5): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(143,19): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(144,11): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(144,35): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(144,36): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
SimpleTiledModel.cs(146,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(146,24): error CS1519: Unexpected symbol `4' in class, struct, or interface member declaration
SimpleTiledModel.cs(146,26): error CS1525: Unexpected symbol `]', expecting `,' or `]'
SimpleTiledModel.cs(146,28): error CS1525: Unexpected symbol `]', expecting `,' or `]'
SimpleTiledModel.cs(148,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
SimpleTiledModel.cs(148,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(148,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(148,28): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(149,3): error CS9010: Primary constructor body is not allowed
SimpleTiledModel.cs(155,9): error CS1519: Unexpected symbol `foreach' in class, struct, or interface member declaration
SimpleTiledModel.cs(155,32): error CS1519: Unexpected symbol `in' in class, struct, or interface member declaration
SimpleTiledModel.cs(155,47): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(155,58): error CS1519: Unexpected symbol `neighbors' in class, struct, or interface member declaration
SimpleTiledModel.cs(155,71): error CS1525: Unexpected symbol `neighbor'
SimpleTiledModel.cs(155,61): error CS1520: Class, struct, or interface method must have a return type
SimpleTiledModel.cs(155,80): error CS1525: Unexpected symbol `)'
SimpleTiledModel.cs(176,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,15): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,23): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,26): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,31): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,46): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,54): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,57): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,62): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(177,4): error CS9010: Primary constructor body is not allowed
SimpleTiledModel.cs(177,4): error CS8041: Primary constructor already has a body
SimpleTiledModel.cs(183,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
SimpleTiledModel.cs(183,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(183,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(183,28): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(184,3): error CS9010: Primary constructor body is not allowed
SimpleTiledModel.cs(184,3): error CS8041: Primary constructor already has a body
SimpleTiledModel.cs(189,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,28): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,43): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,51): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,54): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,59): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(190,4): error CS9010: Primary constructor body is not allowed
SimpleTiledModel.cs(190,4): error CS8041: Primary constructor already has a body
SimpleTiledModel.cs(202,20): error CS1525: Unexpected symbol `bool', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
Compilation failed: 115 error(s), 0 warnings
mxgmn commented 6 years ago

Yeah, it's a versioning issue, it doesn't understand local functions that were added in C# 7. To solve it, either change local functions to Func<> and Action<> (see the syntax in the first commit) or use a compiler that supports C# 7. I think Mono should, just need to enable it somehow, latest NET Core definitely does.

nornagon commented 5 years ago

FWIW, I managed to compile and run successfully on macOS with:

$ brew install mono mono-libgdiplus
$ csc *.cs -r:System.Drawing.dll
$ mono Main.exe