Why is build tasks not showing up in VSCode? - visual-studio-code

Hi I'm doing Unreal 5 Udemy Course and in video it is this image
But when I try it looks like this
I am changed to MSVC version v14.30 - 17.0 so that my UE5 live coding works but i don't think that is why build tools are not showing. But not sure how it would be fixed. What can it be do you know?

So the problem is that you haven't build anything, as I understood.
You need to make something like that in your dir
Workplace look with correct tasks.json
{PathToYourUeProjDir}/.vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "UnrealGame Mac Development Build",
"group": "build",
"command": "/Users/Shared/Epic Games/UE_5.0/Engine/Build/BatchFiles/Mac/Build.sh",
"args": [
"UnrealGame",
"Mac",
"Development",
"-waitmutex",
"-architecture=arm64"
],
"problemMatcher": "$msCompile",
"dependsOn": [
"UnrealBuildTool Mac Development Build"
],
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
}
},
]
}
You may need to correct "command" path, it is path to your ue5.
And you may also need to correct options.cwd, here I'm not sure
Then you just build with cmd+shift+B.
Keep in mind that I installed the xcode version 13 (it is still recommended by UE) from apple dev. And in xcode-preferences-locations I set up command line tools to xcode13. I'm not sure is it crucial, but that is the way it works for me now.

Related

How to set up a Zephyr Project App in VSC?

I am trying to use VSC to develop and debug embedded C applications with Zephyr OS. Is this possible? Are there instructions to set this up? Is there a zephyr setup extension? The Zephyr documentation discusses how to debug apps on eclipse, and there is an eclipse/zephyr plug-in, but I'd prefer to use VSC if possible.
Since Zephyr utilizes CMake, I thought I follow the VSC CMake project tutorial. When it asks to select a kit, there was nothing appropriate for zephyr, so I left it with no active kit selected. With this setting, I am actually able to get a successful build for the blinky example but cannot debug the project. The error I get is:
ERROR: Unable to start debugging. Unexpected GDB output from command
"-exec-run". Don't know how to run. Try "help target". The program
'/home/mustafa/Code/Sycamore/hello_world/build/zephyr/zephyr.elf' has
exited with code 42 (0x0000002a).
If anyone has any input on how to address this error or instructions on setting up a zephyr project in VSC, that would be great. Thx!
Only few steps enough:
Add necessary folders to workspace like:
"folders": [
{
"path": ".",
"name": "app"
},
{
"path": "..\\zephyr",
"name": "zephyr"
},
{
"path": "..\\mcuboot"
},
{
"path": "..\\modules\\hal\\stm32"
}
]
Install Cortex-Debug extension
Setup debug session in file .vscode/launch.json:
"configurations": [
{
"name": "App",
"cwd": "${workspaceRoot}",
"executable": "./app/build/zephyr/zephyr.elf",
"request": "attach",
"type": "cortex-debug",
"serverpath": "C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServerCL.exe",
"servertype": "jlink",
"device": "stm32f412RE",
"interface": "swd",
"svdFile": "./STM32F412.svd"
},
{
"name": "Bootloader",
"cwd": "${workspaceRoot}",
"executable": "./boot/build/zephyr/boot.elf",
"request": "launch",
"type": "cortex-debug",
"serverpath": "C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServerCL.exe",
"servertype": "jlink",
"device": "stm32f412RE",
"interface": "swd",
"runToMain": true,
"svdFile": "./STM32F412.svd"
}

Starlark debugger for Bazel in Visual Studio Code

i am new to Visual studio Code. I followed this tutorial to set up a Bazel build configuration in Visual studio code (I use Windows 10).
I created a simple task.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build Example (Debug)",
"type": "shell",
"command": "bazel build //main:hello-world -c dbg",
"windows": {
"command": "bazel build //main:hello-world --experimental_enable_runfiles -c dbg"
},
"osx": {
"command": "bazel build //main:hello-world -c dbg --spawn_strategy=standalone",
},
"group": {
"kind": "build",
"isDefault": true
},
}
]
}
and launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "cppvsdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"preLaunchTask": "Build Example (Debug)",
"cwd": "${workspaceFolder}/bazel-out/x64_windows-dbg/bin/example.exe.runfiles/__main__/",
"program": "${workspaceFolder}/bazel-out/x64_windows-dbg/bin/main/hello-world.exe",
"externalConsole": false,
"windows": {
"type": "cppdbg",
"type": "cppvsdbg",
"cwd": "${workspaceFolder}/bazel-out/x64_windows-dbg/bin",
"program": "${workspaceFolder}/bazel-out/x64_windows-dbg/bin/main/hello-world.exe",
},
},
}
]
}
In this way with run-> start debugging, I am able to debug and stop to breakpoins within the .cpp code of my project.
However, I read here, that is also possible to use the Starlark debugger to debug the .bzl files and Starlark rules.
According to the instructions in the same page I should be able to do this "by right-clicking a build target in the Bazel Build Targets view and selecting "Build Target with Starlark Debugger"". Unfortunately i can't see this option in my Bazel Build Targets view windows:
The Bazel Build Targets view is empty. and if i right click i can't see the "Build Target with Starlark Debugger" option. According to this link i should be able to see my targets listed below Bazel Build Targets view. I guess i am missing something in the configuration of the project or maybe some starlack extension?
Thanks for any help.
Bazel build targets does not work for me on windows either. When I run it, the extension outputs some error about bazel query. I haven't been on windows recently enough to remember the exact message, but I believe it is something along the lines of what is documented in this open issue.
Looks like there is a pull request open to solve it but no one has reviewed it yet. Best bet might be to weigh in over on either one of those after checking your extension output error log to see if it matches what is documented in there. Alternatively, you can check out the Clion with Bazel plugin, I have not tried that on windows yet though.

Cannot Debug C++ in VS Code

I want to debug my C++ code in VSCode, but after I pressed F5, the external console didn't pop up as expected.
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Debug",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": true,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": true,
"internalConsoleOptions": "neverOpen",
"MIMode": "gdb",
"miDebuggerPath": "E:\\MinGW\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"preLaunchTask": "Compile for Debug"
}
]
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile for Debug",
"type": "shell",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}",
"-g",
"-Wall",
"-Wextra",
"-Wl,--stack=1024000000"
]
}
]
}
When I press F5, the window looks like this:
enter image description here
It seems that the debug session runs normally (the bar in the red box), but as you can see, the external console doesn't appear.
P.S. My system is Windows 10 (x64), and the vscode is the latest.
Finally, I know how to solve that. It seems a bug of C/C++ extension.
I just set the option "Beta: Use Unicode UTF-8 for worldwide language support" in Windows OFF, and everything works.
More details can be found here.
Thanks a lot to Github user #everything411.
From what I can tell looking at your picture, is that I the program stopped at your break point (I don't use the same version so I'm not entirely sure). You have to click next for your program to finish compiling. If you just want to see what your output is, no break points or anything, hit Crtl + F5.
You can follow this link to learn how to use C++ debugger in Linux:
VS Code Debugger for C++
This tutorial is the official tutorial by the Microsoft VS Code Community.
Follow the steps and you will get to know how to debug C++ files.
Note: You need to have a project folder and keep you .cpp inside it.

issues debugging polymer straight from IDE/edit tool

I am quite new to Polymer and I would like to be able to debug projects straight from one IDE. I mean, instead of using Chrome debugger, I would prefer debug from Visual Studio Code or Sublime or Atom or another tool (kindly, there is no interest in this question to compare the IDEs available. I just want some way to debug from any IDE).
All subjects I have read so far didn't me drive to any real tutorial which could help me. The only one I found I couldn't make it run.
I followed https://medium.com/collaborne-engineering/debug-polymer-tests-with-vs-code-7646d66d0608 and when I try Run WCT I get Attribute 'program' doesn't exist.
My launch.json is
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run wct",
"program": "${workspaceFolder}\\my-company-component.html",
"args": [
"-p",
"--skip-plugin", "local",
"--plugin", "none",
"--webserver-port", "2000",
"--expanded",
"--simpleOutput", "${workspaceFolder}"
]
},
{
"type": "chrome",
"request": "launch",
"name": "Run chrome for wct",
"url": "http://localhost:2000/components/my-company-component/generated-index.html",
"webRoot": "${workspaceRoot}",
"userDataDir": "${workspaceRoot}/.vscode/chrome"
}
]
}
Today, I have been using gulp to start a local server and then debug using Chrome but, in case it is possible use an IDE + some extension/plugin I would prefer.
program should be either 'wct' if you installed it with -g or
"${workspaceRoot}/node_modules/.bin/wct" if you installed it locally using npm.
That should solve your error, I did not get the other parts to work still though..
Well, after several tentatives and searching for while, I assume that the only way to debug is by using Chrome. I mean, I didn't find any efficient way to debug using Visual Studio Code, Atom or other IDE. I will consider https://github.com/Polymer/polymer/issues/3635 as an answer to my question.

Why is dotnet run completely different than VS Code debug

I have started a few unmodified projects using dotnet new -t web. I have tried to restore using VS Code v 1.8.1 and dotnet restore. From the tutorials I have followed on dot.net and mva.microsoft.com there shouldn't be any difference in the projects at that point. I think that's right and I have not modified the project in question. When I run the same fresh project in the same browser using dotnet run then open a browser the left side of the image is the result as expected. When I try to run using F5 or pressing the run button on VS Code then the right side of the image is the result. All the practice I have had watching Elmo with my daughter has helped me come to the conclusion that one of these things is not like the other.
The proximate cause is that VS Code runs the site without a valid reference to necessary resources like the Bootstrap CSS file. Incorrectly, VS Code references Bootstrap at http://localhost:5000/lib/bootstrap/dist/css/bootstrap.css, while running the project with dotnet run is more fruitful and uses the following external URL: https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.min.css. Is this a bug that will be fixed eventually and is there some documentation that would help fix this?
From the looks of the .vscode folder and the comment so far, the tasks.json file seems to be a key difference. Here is the file content:
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [
"${workspaceRoot}\\project.json"
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
}
Here is the launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.0\\Avalon.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command.pickProcess}"
}
]
I did have the same issue.
The workaround is as follows:
Either run:
bower install
For this you need to install nodejs and git
Install Node.js from https://nodejs.org/
Install git from https://git-scm.com/
npm install -g bower
bower install
Or open _Layout.cshtml, and change line 9 to:
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.css" />
Please have a look at the deeper explanation to this problem explained here:
https://github.com/dotnet/cli/issues/4076
Regards,
Thomas