Unreal Engine5 LiveCoding causes error `(missing LinkerPath field)` - c++

I'm a new to unreal engine5. I made a blue print project, and added a c++ file, but when compiled, It causes the error, unable to parse C:/program Files/Epic Games/UE_5.1/Engine/Intermediate/LiveCoding.json (missing LinkerPath field) as the above. so, I added the LinkerPath field to "C:\Program Files\Epic Games\UE_5.1\Engine\Intermediate\LiveCoding.json" like this:
{
// the `LinkerPath` field is added, the others not changed.
"LinkerPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\Hostx64\\x64\\link.exe",
"LinkerEnvironment": {
"LOCALAPPDATA": "C:\\Users\\우수컴\\AppData\\Local",
"OneDrive": "C:\\Users\\우수컴\\OneDrive",
"UE_DesktopUnrealProcess": "1",
"ProgramFiles(x86)": "C:\\Program Files (x86)",
"__COMPAT_LAYER": "ElevateCreateProcess",
"PROMPT": "$P$G",
"PUBLIC": "C:\\Users\\Public",
"SystemRoot": "C:\\WINDOWS",
"SESSIONNAME": "Console",
"SystemDrive": "C:",
"USERNAME": "우수컴",
"CommonProgramFiles": "C:\\Program Files\\Common Files",
"DriverData": "C:\\Windows\\System32\\Drivers\\DriverData",
"USERPROFILE": "C:\\Users\\우수컴",
"COMPUTERNAME": "DESKTOP-OBEKLM1",
"OPENSSL_ia32cap": ":~0x20000000",
"CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files",
"PROCESSOR_LEVEL": "6",
"NUMBER_OF_PROCESSORS": "24",
"CommonProgramW6432": "C:\\Program Files\\Common Files",
"LPP_PROCESS_RESTART_ID": "37608",
"APPDATA": "C:\\Users\\우수컴\\AppData\\Roaming",
"TEMP": "C:\\Users\\우수컴\\AppData\\Local\\Temp",
"USERDOMAIN": "DESKTOP-OBEKLM1",
"windir": "C:\\WINDOWS",
"HOMEPATH": "\\Users\\우수컴",
"PROCESSOR_ARCHITECTURE": "AMD64",
"HOMEDRIVE": "C:",
"ZES_ENABLE_SYSMAN": "1",
"Path": "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22000.0\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft\\jdk-11.0.12.7-hotspot\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files\\dotnet\\;C:\\Users\\우수컴\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\우수컴\\.dotnet\\tools;C:\\Users\\우수컴\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
"VC_COMPILER_PATH": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe",
"PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 183 Stepping 1, GenuineIntel",
"PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC",
"ProgramFiles": "C:\\Program Files",
"OS": "Windows_NT",
"LOGONSERVER": "\\\\DESKTOP-OBEKLM1",
"FPS_BROWSER_APP_PROFILE_STRING": "Internet Explorer",
"ComSpec": "C:\\WINDOWS\\system32\\cmd.exe",
"PROCESSOR_REVISION": "b701",
"UBTPath": "\"..\\..\\Engine\\Binaries\\DotNET\\UnrealBuildTool\\UnrealBuildTool.dll\"",
"ProgramW6432": "C:\\Program Files",
"ALLUSERSPROFILE": "C:\\ProgramData",
"PSModulePath": "C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules",
"USERDOMAIN_ROAMINGPROFILE": "DESKTOP-OBEKLM1",
"VC_COMPILER_DIR": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64",
"FPS_BROWSER_USER_PROFILE_STRING": "Default",
"ProgramData": "C:\\ProgramData",
"EOS_OVERLAY_ENABLE_VULKAN_WIN64": "1",
"TMP": "C:\\Users\\우수컴\\AppData\\Local\\Temp"
},
"Modules": [
]
}
But the result is same. How do I solve this error?.

Related

Enable jasmine/globals in unit testing

In my .eslintrc.json file(which inherits from a root .eslintrc.json file), I have this configuration
"extends": ["<root>/.eslintrc"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": ["<path>/tsconfig.*?.json"]
},
"settings": {
"disable/plugins": ["jest"]
}
},
]
}
The root .eslintrc.json file has
"plugins": ["#nrwl/nx", "jest", "jasmine"],
"extends": ["plugin:jest/recommended", "plugin:jasmine/recommended"],
For my project I only need to use jasmine and not jest. While the test runs successfully, I get a lint error of
error Illegal usage of global `spyOn`, prefer `jest.spyOn` jest/no-jasmine-globals
On adding rules: {"jest/no-jasmine-globals": "off"} and "env": { "jasmine-globals": true } I get another lint error that says jasmine-globals could not be identified
I need to suppress the jest plugins and allow jasmine alone. What are the modifications that I need to do?

${relativeFile} fetched by visualstudio / cmake launch json file is not including the backslash

I have configured some tasks for CMake in Visual studio. One of the commands to execute includes the ${relativeFile} and it is under subdirectory. The fetched result is not including the '/' to separate the directories.
Here is the tasks.vs.json file sample:
{
"taskName": "TestTask",
"appliesTo": "*/",
"type": "remote",
"remoteWorkingDirectory": "/home/root/",
"contextType": "custom",
"localCopyDirectory": "${workspaceRoot}\\..\\build\\${env.name}\\bin",
"remoteMachineName": "${env.TARGET_MACHINE}",
"remoteCopyMethod": "sftp",
"remoteCopyDirectory": "/tmp/",
"command": "echo changing permissions for ${relativeFile}",
"args": ""
}
Expected result: changing permissions for test\test1
Current Result: changing permissions for testtest1

Why Chutzpah does not recognize all TypeScript tests?

I have a project with the following chutzpah.json:
{
"Framework": "jasmine",
"TestHarnessReferenceMode": "AMD",
"TestHarnessLocationMode": "SettingsFileAdjacent",
"EnableTestFileBatching": true,
"References": [
{ "Path": "node_modules/es6-shim/es6-shim.min.js" },
{ "Path": "node_modules/zone.js/dist/zone.min.js" },
{ "Path": "node_modules/reflect-metadata/Reflect.js" },
{ "Path": "node_modules/systemjs/dist/system.js" },
{ "Path": "system-config.js" }
],
"CodeCoverageExcludes": ["node_modules/*"],
"Tests": [
{ "Path": "app", "Includes": [ "*.spec.ts" ] }
]
}
and the following tests files
Test explorer just shows tests stored in the first file
If I try to run the the command of the VSTest I get the same result:
If I call the command setting the name of the file (e.g. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" app\InspectionDataView.spec.ts /UseVsixExtensions:true ), the tests in the file run.
Extra point:
I tried to run the test directly with Chutzpah.console.exe, this is what I got:
What am I missing here ?
Note: Using VS 2015 Update 3
Chutzpah does not run TypeScript. It "supports" it, but you have to add this support in the chutzpah.json.
Why the first test suite succeeds? Perhaps it is written in pure ES5 (Without ES6/TS classes, interfaces, etc).
I did set up chutzpah support for typescript from this repo https://github.com/mmanela/chutzpah/tree/master/Samples/Compilation/TypeScript
Basically, in short:
create a compile.bat that transpiles TS to ES5. Normally - tsc.exe with or without tsconfig.json
add "Compile" section as seen in https://github.com/mmanela/chutzpah/blob/master/Samples/Compilation/TypeScript/chutzpah.json
this shall transpile TS to ES5 every time you run chutzpah.console.exe

Simple TypeScript Testing with Chutzpah not Working

I'm trying to run the most basic of TypeScript tests using Jasmine and Chutzpah and I just can't get it to work. Here is the source file:
class Simple {
public easyTest() {
return 5;
}
}
Here is the spec:
/// <reference path="../../../scripts/typings/jasmine/jasmine.d.ts" />
/// <reference path="../../../src/typescript/classSimple.ts" />
describe("Simple Calculations", () => {
it("should return true", () => {
var simpl = new Simple();
expect(simpl.easyTest()).toBe(5);
});
});
Here is my chutzpah.json file:
{
"RootReferencePathMode": "SettingsFileDirectory",
"Framework": "jasmine",
"Compile": {
"Mode": "External",
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ]
},
"References": [
{ "Path": "../../../src/typescript/classSimple.ts" }
],
"Tests": [
{ "Path": "simpleSpec.ts" }
],
"EnableTracing": true
}
Here is the folder structure
TestProject.sln
-src
--typescript
---classSimple.ts
-tests
--jasmine
---typescript
----chutzpah.json
----simpleSpec.ts
This VS.NET project is set to compile TypeScript upon save and I'm physically looking at the transpiled JavaScript output: classSimple.js in the exact same directory next to classSimple.ts. Yet when I run the spec using Chutzpah I get the following:
Message:Chutzpah run started in mode Execution with parallelism set to
4 Message:Building test context for
C:\dev\TestProject\tests\jasmine\typescript\simpleSpec.ts
Message:Building test context for
'C:\dev\TestProject\tests\jasmine\typescript\simpleSpec.ts'
Message:Test file
c:\dev\TestProject\tests\jasmine\typescript\simplespec.ts matched test
file path from settings file Message:Investigating reference file path
'../../../src/typescript/classSimple.ts' Message:Added file
'C:\dev\TestProject\src\typescript\classSimple.ts' to referenced
files. Local: True, IncludeInTestHarness: True Message:Processing
referenced file 'C:\dev\TestProject\src\typescript\classSimple.ts' for
expanded references Message:Added framework dependency
'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\jasmine_favicon.png' to referenced files Message:Added framework dependency
'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\boot.js'
to referenced files Message:Added framework dependency
'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\jasmine-html.js'
to referenced files Message:Added framework dependency
'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\jasmine.js'
to referenced files Message:Added framework dependency
'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\jasmine\v2\jasmine.css'
to referenced files Message:Added framework dependency
'C:\Users\myself\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\mfv4e3ra.luv\TestFiles\chutzpah_boot.js'
to referenced files Message:Finished building test context for
C:\dev\TestProject\tests\jasmine\typescript\simpleSpec.ts Error: 0 :
Time:22:47:48.6888513; Thread:23; Message:Can't find location for
generated path on C:\dev\TestProject\src\typescript\classSimple.ts
Warning: 0 : Time:22:47:48.6978503; Thread:23; Message:Chutzpah
determined generated .js files are missing but the compile mode is
External so Chutzpah can't compile them. Test results may be wrong.
Information: 0 : Time:22:47:48.7038522; Thread:23; Message:Found
generated path for
C:\dev\TestProject\tests\jasmine\typescript\simpleSpec.ts at
c:\dev\TestProject\tests\jasmine\typescript\simpleSpec.js Error: 0 :
Time:22:47:48.7088508; Thread:23; Message:Couldn't find generated path
for C:\dev\TestProject\src\typescript\classSimple.ts at
And that's it - it just cuts off on the end and nothing happens. The thing is, I see the .js files exactly in the location stated within the trace above, but Chutzpah is claiming Couldn't find generated path for...
This is as simple as it gets for unit testing. I know the tests work independently of the .ts files because if I run just the .js files the tests pass.
What am I doing incorrectly?
Thanks for posting the very detailed repro. You are hitting an issue I have seen a couple times. Since your chutzpah.json is nested in your test folder you need to specify the folder path mapping that chutzpah should use for determining how to map from source to output folder. To do this just change your chutzpah.json to:
{
"RootReferencePathMode": "SettingsFileDirectory",
"Framework": "jasmine",
"Compile": {
"Mode": "External",
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ],
"Paths": [
{ "SourcePath": "../../../", "OutputPath": "../../../"}
]
},
"References": [
{ "Path": "../../../src/typescript/classSimple.ts" }
],
"Tests": [
{ "Path": "simpleSpec.ts" }
],
"EnableTracing": true,
"TraceFilePath": "trace.txt"
}
The other workaround would be to just place the chutzpah.json at the root of your project.
I need to look into making Chutzpah better to avoid this. I think I will look at letting chutzpah in this situation just assume the file is co-located to avoid this common pitfall.
Google led me here for a similar issue:
Some new tests in my Chutzpah project are written in TypeScript and compiled into a single outfile:
tsconfig.json
"compilerOptions": {
"noImplicitAny": true,
"target": "es5",
"module": "none",
"outFile": "./Tests/mytests-ts.js",
"sourceMap": true
}
Chutzpah couldn't find the *.ts files
Chutzpah Error: System.IO.FileNotFoundException: Couldn't find generated path for D:\Code\ChutzpahProject\Scripts\DateServiceMock.ts
until I used the Paths option:
chutzpah.json
"Compile": {
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ],
"Executable": "build-ts.cmd",
"Paths": [
{ "OutputPath": "Tests/mytests-tests-ts.js" }
]
},
This feels like it could have been a comment to #matthew-manela's answer...I think.

Cannot run C++ program when using sublime-build, works fine when running from terminal

I'm trying to run a C++ program on Linux/Ubuntu 14.04
I'm using the SFML library, the tutorial suggests to include this line before running if SFML was installed in a non-standard path (which it was):
$ export LD_LIBRARY_PATH=<sfml-install-path>/lib
I can run the program from the terminal using the following input:
$ export LD_LIBRARY_PATH=/home/dan/SFML-2.3.1/lib && ./YorickTheSavant
However, when attempting to launch the program in Sublime Text 2 with a sublime-build file, I get the following error:
[Errno 2] No such file or directory
[cmd: [u'export', u'LD_LIBRARY_PATH=/home/dan/SFML-2.3.1/lib', u'&&', u'./YorickTheSavant']]
[dir: /home/dan/yorickthesavant]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/dan/.rvm/bin]
[Finished]
Here is my sublime-build file for reference:
{
"cmd": ["g++", "-m32", "-c", "-std=c++11",
"src/buff.cpp",
"src/card.cpp",
"src/clickableObject.cpp",
"src/creature.cpp",
"src/dataHandler.cpp",
"src/dungeonRun.cpp",
"src/enemy.cpp",
"src/gameQueue.cpp",
"src/gameSystem.cpp",
"src/graphics.cpp",
"src/hoverText.cpp",
"src/infoText.cpp",
"src/main.cpp",
"src/player.cpp",
"src/queueBlock.cpp",
"src/queueEffect.cpp",
"src/roundedCornerRect.cpp",
"src/save.cpp",
"src/ttText.cpp",
"-I", "include"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "/home/dan/yorickthesavant/",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Link",
"cmd": ["g++", "-m32",
"buff.o",
"card.o",
"clickableObject.o",
"creature.o",
"dataHandler.o",
"dungeonRun.o",
"enemy.o",
"gameQueue.o",
"gameSystem.o",
"graphics.o",
"hoverText.o",
"infoText.o",
"main.o",
"player.o",
"queueBlock.o",
"queueEffect.o",
"roundedCornerRect.o",
"save.o",
"ttText.o",
"-o", "YorickTheSavant",
"-L", "/home/dan/SFML-2.3.1/lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system"]
},
{
"name": "Run",
"cmd": ["export", "LD_LIBRARY_PATH=/home/dan/SFML-2.3.1/lib", "&&", "./YorickTheSavant"]
}
]
}
The "Run" variant is the one I'm using. How would I make it so that this line is automatically included when the game is launched outside of the terminal and in Sublime Text 2?
The cmd key in .sublime-build files specifies the program to run.
The first value is expected to be the program and the rest are the arguments,
so it fails when it cannot find a program called export - because it is a shell built-in.
To run the entire command in a shell (like you would when doing it manually), you can specify "shell" : true in your Run variant (or use shell_cmd instead of cmd):
{
"name": "Run",
"cmd": ["export", "LD_LIBRARY_PATH=/home/dan/SFML-2.3.1/lib", "&&", "./YorickTheSavant"],
"shell" : true
}
This should work better than invoking /bin/sh -c <stuff> directly, and I don't think you'll need to condense the entries in the cmd array into a single string anymore.
Alternatively, you could also try using the env key (also found here) to specify the LD_LIBRARY_PATH environment variable before running your executable:
{
"name": "Run",
"cmd": ["./YorickTheSavant"],
"env" : { "LD_LIBRARY_PATH" : "/home/dan/SFML-2.3.1/lib" }
}