Handmade Hero»Forums»Code
4 posts
None
Day 001: Noobie with Visual Studio and having a rather large issue
Edited by DCoward on
Hey all

I'm new to Visual Studio, the forums, and HMH!

This is my first post, but it's a fairly urgent one, in that I need to know what I'm doing wrong to continue at all in the way Casey is showing us.

(As a side note: I'm not totally foreign to code/coding -- I actually have a fairly good grasp of basic things, as well as a lot of general command line function overall)

My setup:
Windows 10
Visual Studio 2015 Community Edition (I explain later, but I also now have 2013 Community Edition and have since deleted 2015)
Sublime Text 3

Problem:
So I've followed both the video (I watched it all the way through once, and relooked at specific parts a bunch) and the notes attached to it. I have now mostly followed the written notes, and I think I noticed a few differences between notes and video (maybe that is part of the issue), but overall I'm to the point now where Casey is using the devenv call and loading it up into VS and running/debugging, and I can't. For whatever reason, I can do the devenv command and VS opens, but no matter what, despite the .cpp file displaying correctly, I'm unable to build/run. Nothing happens. I don't get a dummy solution.

I did research and unfortunately I didn't really find much except a few things here and there that suggested that I may need to load it up into a project to run at all, so I tried that. I tried lots of different project types, and that didn't work. So, rather drastically, I jsut decided "Screw it" and switched out 2015 for 2013 -- still Community Version -- to really be on the same material aside from Emacs, and the exact same issues still occur.

So now I am vitally stuck where I have all of the stuff, but none of the proof, because I can't actually see that anything I've done is correct.

I'd love it if someone could weigh in and tell me what I'm doing wrong!

TL;DR devenv isn't letting me do anything in VS -- it brings it up, but I can't do anything and it's a mystery to me.

(P.S. I couldn't find a search function here and I didn't really want to sift through 39 pages, so if this has been answered already I apologize if it's already solved!)

EDIT: So I hammered at it some more and on the off-chance I accidentally changed the code in the .cpp file, and it showed that it certainly was opening a dummy solution, however I was still completely unable to debug, regardless of if I included a breakpoint or not.

So still nowhere, but that seems like an important distinction.
Mārtiņš Možeiko
2559 posts / 2 projects
Day 001: Noobie with Visual Studio and having a rather large issue
If you are talking about running devenv on exe file, then this is what is expected. It doesn't open "project" with all your source files visible in solution explorer. It creates special empty solution suited for debugging executable. It won't be able to build your project, and it won't show source files in solution explorer. If you want to see your cpp files you need to open them manually (File -> Open), or just start stepping into source and it will automatically open current source line.

You should be able to run/debug executable though. What happens if you launch process under Debug menu?
4 posts
None
Day 001: Noobie with Visual Studio and having a rather large issue
As far as I know, I'm completely unable to do anything once I run devenv and get the file in VS.

I've looked through like every menu, and pretty much everything is greyed out -- including debug stuff.

I may be using incorrect terminology, but essentially I'm wholly unable to replicate what Casey does. I'm unable to see what progress I have, due to that.
44 posts
Day 001: Noobie with Visual Studio and having a rather large issue
I see you use sublime as text editor, so I assume you compile with cl.exe, did you are able to produce a working exe file?
Can you execute it on the commandline? You wrote a build.bat?
Then you if call devenv /whateveris/yourcompiledfile.exe then you be able to step into the code...
Hope any of that helps
Cheers
4 posts
None
Day 001: Noobie with Visual Studio and having a rather large issue
I do use Sublime, but I am following the text notes supplied with the videos here. It said nothing about cl.exe, but I'm only using Sublime as an alternative to emacs (at least I think I am). Thus I thought I just needed to make everything Casey did (which I think is pretty much done in the text tutorial?), and I do, but when it gets to devenv, I try it, it opens VS, but I can't do anything. I can't debug, I get nothing to show me what I did.

As far as I know I just can't use Visual Studio and this doesn't have anything to do with Sublime. I could be wrong but it seems like a VS problem.
4 posts
None
Day 001: Noobie with Visual Studio and having a rather large issue
Hey all, I just wanted to update that I figured out what it was. Turns out it was not a VS problem -- it was actually (unsurprisingly) on me.

I had accidentally not included whitespace in my build.bat, and it was not building -- so I thought it must be that the build would come later (since I was following the text tutorials) -- turns out that was preventing it. Thus when I saw in the video that Casey was compiling the .exe, I was thinking it was the .cpp, and that just wasn't working.

I appreciate the help people attempted to help, but now it's a non-issue.

Thank you anyway!
44 posts
Day 001: Noobie with Visual Studio and having a rather large issue
You are welcome!