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# C# Objects Methods Return Values

Getting an error " bash: -out:TreehouseDefense.exe: command not found " when running my code. What is my code missing?

My code is not printing True and False as it does in the video. However, I can't identify where I've gone wrong.

Here's the snapshot of my Workspace: (link)[https://w.trhou.se/azfxojhbfn]

2 Answers

Steven Parker
Steven Parker
230,178 Points

It sounds like your compile command might be missing the "mcs" keyword. To compile your code, you would typically type something like this:

mcs -out:TreehouseDefense.exe *.cs

Also, it looks like your Point.cs has a brace out of place. The one currently on line 7 should probably come after line 12.

Steven Parker
Steven Parker
230,178 Points

That warning isn't going to keep the program from compiling or running. If you didn't miss any steps in building the program, it could just be something that has been defined in preparation for being used in a later step of the course.

Thanks, Steven! I updated the code with your suggestions and it cleared all the errors. However, I received the following warning message from the Console upon after compiling:

Tower.cs(5,11): warning CS0414: The private field `TreehouseDefense.Tower.tower' is assigned but its value is never used
Compilation succeeded - 1 warning(s)

Workspace snapshot here: (link)[https://w.trhou.se/gg0warweqj]

Thoughts?