# HXCPP Won't debug in VSCode

**URL:** https://community.haxe.org/t/hxcpp-wont-debug-in-vscode/4070
**Category:** Haxe
**Tags:** haxe-cpp, vscode
**Created:** [November 1, 2023, 8:49pm UTC](https://community.haxe.org/t/hxcpp-wont-debug-in-vscode/4070 "2023-11-01T20:49:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Reghalt](https://avatars.discourse-cdn.com/v2/letter/r/5f9b8f/32.png) [@Reghalt](https://community.haxe.org/u/Reghalt)
#### Post date: [November 1, 2023, 8:49pm UTC](https://community.haxe.org/t/hxcpp-wont-debug-in-vscode/4070/1 "2023-11-01T20:49:04Z")

</div>

Hey! So I have seen other people had this issue a while back but nothing they did worked for me.

I am trying to run the [HaxeRepro](https://github.com/Gama11/HaxeRepro/tree/master) project on MacOS Ventura with VSCode 1.84.0.

I am running the C++ launch config and I have hxcpp-debugger installed and all the extensions for VSCode, but I can’t get the debug server to launch.

Everything else works. The Main-debug executable is created and runs, but in VSCode the trace(“Test”) does not output to the console and the breakpoint doesn’t get hit.

Anybody else having this issue?

Thanks

---

<div class="post-metadata">

### Author: ![Reghalt](https://avatars.discourse-cdn.com/v2/letter/r/5f9b8f/32.png) [@Reghalt](https://community.haxe.org/u/Reghalt)
#### Post date: [November 3, 2023, 9:16pm UTC](https://community.haxe.org/t/hxcpp-wont-debug-in-vscode/4070/2 "2023-11-03T21:16:10Z")

</div>

To anyone who reads this, I want you to know I am a moron. The file that gets generated on a mac doesn’t have a .exe extension but the launch.json is looking for it… so you just remove the .exe part in the launch.json and it works perfectly. On the plus side the weekend is now looking fun!

---

<div class="post-metadata">

### Author: ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)
#### Post date: [November 4, 2023, 9:44am UTC](https://community.haxe.org/t/hxcpp-wont-debug-in-vscode/4070/3 "2023-11-04T09:44:55Z")

</div>

Another thing to know is the “-debug” suffix in the executable name is only there in debug mode, so if you build in release mode it’ll only be named Main.  
I ended up debugging the wrong exe several times because of that.

If you add to your hxml:

```plaintext
--define HAXE_OUTPUT_FILE=myapp

```

the executable will be named myapp both in release and debug mode, which can be useful.

---

<div class="post-metadata">

### Author: ![Reghalt](https://avatars.discourse-cdn.com/v2/letter/r/5f9b8f/32.png) [@Reghalt](https://community.haxe.org/u/Reghalt)
#### Post date: [November 4, 2023, 7:24pm UTC](https://community.haxe.org/t/hxcpp-wont-debug-in-vscode/4070/4 "2023-11-04T19:24:52Z")

</div>

Thank you, that is actually really useful to know.

Not sure you would have the answer to anothe question, but I can’t get VSCode to recognise SDL. It all compiles, launches, and debugs but vscode shows a bunch of red squiglies and there is no intellisense.

Not sure if it is possible to get the haxe extension to know about the linc\_sdl.

---

<div class="post-metadata">

### Author: ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)
#### Post date: [November 4, 2023, 8:07pm UTC](https://community.haxe.org/t/hxcpp-wont-debug-in-vscode/4070/5 "2023-11-04T20:07:33Z")

</div>

If you have the correct hxml used you should have code completion.

Do you add any arguments to it in a task instead of having it in the hxml?  
That would make it work only when compiling but not in the ide.

Or maybe you have multiple hxml? If so be sure to check which one is used, you can check in the status bar.

---

<div class="post-metadata">

### Author: ![Reghalt](https://avatars.discourse-cdn.com/v2/letter/r/5f9b8f/32.png) [@Reghalt](https://community.haxe.org/u/Reghalt)
#### Post date: [November 4, 2023, 9:09pm UTC](https://community.haxe.org/t/hxcpp-wont-debug-in-vscode/4070/6 "2023-11-04T21:09:43Z")

</div>

Yeah that worked! Just added to build.hxml:

-lib linc\_sdl

-D mac

Now I have code completion and it compiles and runs.

Thank you so much.
