Handmade Hero»Forums»Code
19 posts
Can Not Debug With MS 2013 Need help With Setup...
I have been using CodeBlocks to type in the source code as the computer I am using had it installed already. I set it up to use the VS linker and compiler no problem but I can not get it to debug.

I made a user tool for it in the tools menu of codeblocks...

Name: VC2013 Debug

Executable: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"

Parameters: /debugexe ${TARGETOUTPUTFILE}

Working directory: ${TARGETOUTPUTDIR}

check the option "Launch tool visible detached"

It bring up the debugger but that's it. I have tried doing it manually using a bat file/dos window but still no luck.

I'll admit to being shaky when it comes to linker and compiler stuff as am used to using a computer with that stuff already installed.

I can follow the code ok and could ignore the debug part of it But I I'd rather follow along properly.

The only reason I use codeblocks is because that is the editor I am most familiar with and I do not want to get bogged down trying to learn a new editor as well as C as am new but not too new.

IF I need to switch to 4coder I would prefer to give a one off payment $25 or so just in case I do not like it once I get going if that it possible. If I do like it ok then less money but more over time I would do. I am just nervous of switching out everything at this time.

Can anyone help me set up debugging in codeblocks or should I switch over to 4coder?
Mārtiņš Možeiko
2358 posts / 2 projects
Can Not Debug With MS 2013 Need help With Setup...
It bring up the debugger but that's it.

What do you mean "that's it"? What is it and what exactly is happening?
If it opens debugger what exactly is wrong with it? If it opens normally, then isn't it what you wanted?
19 posts
Can Not Debug With MS 2013 Need help With Setup...
No it just lunches VS 2013 that's all...

I think it would be better if I set things up from scratch the way Casey did it. As am not fully understanding the process I guess.

I have Startup.bat inside windows startup folder

SUBST W: F:\Work

In my W: drive I have HomeMade folder... And inside that I have a Build, Code, Data and Misc.

Inside Code folder I have Build.bat


pushd ..\..\build
cl -Zi ..\code\win32_handmade.cpp user32.lib

Inside the Misc folder I have I have Shell.bat

CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
SET PATH=W:\HomeMade\Misc;%PATH%

Is this all correct so far?
15 posts
Can Not Debug With MS 2013 Need help With Setup...
It's correct if it works! :P

Given how you've described your desired directory structure, if you want to keep your build folder inside HomeMade then it should be:

pushd ..\build

Also, vcvarsall.bat takes an argument that encapsulates what architecture you're building on and what architecture you're building for, so:

CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64

Now if you want to know if it's all correct so far, open your Command Prompt and type "set". You should see, in addition to the usual environment variables that are there, things like INCLUDE, UCRTVersion, etc. You should also be able to type "cl /help" and not get an error. (I'm assuming you've tied execution of shell.bat to your cmd shortcut since you're setting everything up Casey's way.)