Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Andreas Gruber
Andreas Gruber
2,142 Points

(1,6): error CS1525: Unexpected symbol `out'

I can't find the error, please help me...

Thank You

Steven Parker
Steven Parker
231,236 Points

We'll need a bit more than just the error message to figure out what's happening

Please provide a link to the course video or challenge, and make a snapshot of your workspace and post the link to it here.

Andreas Gruber
Andreas Gruber
2,142 Points

https://w.trhou.se/qfgy7e57jh

I've searched this feature already thank you :)

1 Answer

Steven Parker
Steven Parker
231,236 Points

I wonder if you got that error from your command line, since it contains the out option. If you're still getting that same error, please show the exact command that you are using.

Here's the command line I used to build your snapshot:
treehouse:~/workspace$ mcs -out:TreehouseDefense.exe *.cs

Now I did get some errors, but different ones not related to the command line:
Path.cs(14,45): error CS1525: Unexpected symbol 'return'
Game.cs(26,36): error CS0103: The name 'pathGetLocationAt' does not exist in the current context

Here's the fix for the first one (notice just one "return"):

Path.cs
//        return (pathStep < _path.Length) ? return _path[pathStep] : return null;
          return (pathStep < _path.Length) ? _path[pathStep] : null;

And here's the fix for the second one (there was a missing period):

Game.cs
//          MapLocation location = pathGetLocationAt(0);
            MapLocation location = path.GetLocationAt(0);

After those fixes, the program built and ran without errors:
treehouse:~/workspace$ mono TreehouseDefense.exe
0, 2

Is that the result you expected?

Andreas Gruber
Andreas Gruber
2,142 Points

Strange... Now I've fixed the two errors which you wrote and it worked... I always debug the program and run it with one command:

mcs -out:TreehouseDefense.exe *.cs && mono TreehouseDefense.exe

Anyhow, thank you for your good and fast responses!!