How do I set the Program type? - unreal-engine4

I'm getting "ERROR: Targets with a unique build environment cannot be built in an installed engine.". This happens even when I build a new blank C++ project and make one specific change.
Inside of MyProject.Target.cs, I change the Type to Program, like so.
Type = TargetType.Program;
After changing that, anytime I try to build, clean, or generate visual studio files I get the error. The error doesn’t happen if I use TargetType.Game. However, I need to use Program so that I can build as a DLL using “bShouldCompileAsDLL = true;“ as documented on (https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/BuildAsALibrary/).
I’m running Unreal Engine 4.27. I need to set the type to Program instead.
Can anyone please help?

You can build it to dll with Game target.
Set both of these envs:
LinkType = TargetLinkType.Monolithic;
bShouldCompileAsDLL = true;

Related

Visual Studio Code does not see changes in F# Solution

Currently I am trying to use Visual Studio Code with Ionide to build a F# Solution. To describe my problem, i first describe what i have done, and what works.
I created a solution with two Projects. One Project is a Queue that contains a F# library. Another project is Queue.Test that is a console application that uses the Queue library, and should contain the Tests for the Queue library.
I'm using .Net6 and created the solution and Project with the dotnet cli tool.
In general, i can build the project with dotnet and i also can use everything in Visual Studio Code. I load the Folder that contains both projects, and Visual Studio Code loads the library.
I am able to edit the Library and my Console application. In my Console application i also can access the Queue and so on. Autocompletion works, and so on.
But, there is one problem. When i add a new function to my library, let's say Queue.help then in my Console application, i cannot see that function. It doesn't show in autocomplete, and when I write code that uses that function i get a compiler error telling me that function doesn't exists.
I can Build/Rebuild from VS Code or from CLI but the problem goes not away.
The only way Ionide starts to see the new function is by building the library AND restarting VS Code. As long i don't restart, it seems to not update the generated dll (i guess).
This is sure annoying, as i don't want to reload/restart VSCode everytime I add a new function to my library.
So my question: How i can I fix this?
What i want is to be able to change my library, and at the same time write tests in the other project and get full Code autocompletion.
Does somebody else have the same problem, or should I change my workflow?
What can i do, to debug this problem on my own?
Some tips?
This issue is fixed by the recent version of Ionide 5.10.1

Creating VSCode Debugger Extension

I'm in the process of trying to write a VSCode extension to support basic SNES application development. I already have a basic grammar definition and build task, so I have syntax highlighting, and am able to build my project with Ctrl+Shift+B using the bass v14 assembler, but now I'm trying to figure out how to launch the project using launch.json. I've already worked through the official docs and played around with the mock debugger project, but I can't seem to figure out how to adapt it for my extension. To start, I'm using the bsnes-plus emulator as my debugger. There isn't really any command-line or IPC interface that will actually allow me to implement a proper debug adapter, so all I really want to do is to run the program and pass it my output file to launch. For the time being, I'm assuming that bsnes-plus.exe is located in my $PATH, but eventually I'll try and figure out the best practices for external executable dependencies for an extension.
So here are my current questions:
Is the "program" field of launch.json my compiled application, or is it bsnes-plus.exe?
If "program" is my application, where do I specify bsnes-plus.exe? Or vice versa.
Is there a way to specify my own project-level variables, e.g. $OUTPUT so that I don't have to hard-code the output filename into both the build task and the launch task?
At one point, I was able to get the launch command to open bsnes-plus, but not load the game, and when I closed it, VSCode complained that the debugger terminated unexpectedly and immediately re-opened bsnes-plus. How do I avoid this? Do I need to write a debug adapter even though it's not going to actually do anything other than launch the application, just so I can tell VSCode that it exited cleanly?
Is the "program" field of launch.json my compiled application, or is it bsnes-plus.exe?
This is entirely up to the debug extension. It's just passed through to the debug adapter. It usually corresponds to the specific app/script being debugged though, not the runtime that's running it, so I would suggest it should be your compiled application.
If "program" is my application, where do I specify bsnes-plus.exe? Or vice versa.
You can put it any other field. In Dart, we have a dartPath field that can be passed through to the debug adapter. It's usually populated silently by the DebugConfigurationProvider.resolveDebugConfig though (we detect the SDK by searching PATH) so the user never needs to add it.
Is there a way to specify my own project-level variables, e.g. $OUTPUT so that I don't have to hard-code the output filename into both the build task and the launch task?
You can't make your own variables, but using resolveDebugConfig you can manipulate the launch config yourself before it's passed to the debug adapter, which probably allows you to do what you need here (eg. you could do a string replace on program - or you could even just add it if it's not set, allowing a launch.json-less launch too).
Do I need to write a debug adapter even though it's not going to actually do anything other than launch the application, just so I can tell VSCode that it exited cleanly?
I'm not sure what happened here without more details, but having a debug adapter probably makes the most sense - for example if you want to make the Stop/Restart buttons work on the toolbar, you'd probably want a debug adapter that can terminate and/or restart the process.

Building NLua from source (Windows): Lua52.dll?

I'm struggling with building NLua from source on Windows.
It requires a modified Lua version, otherwise my code fails with a missing "lua52.dll".
https://github.com/NLua/NLua/issues/53
I tried to get it from here
https://github.com/NLua/lua
then used "cmake ." and built the resulting "lua.sln" in visual studio.
What happens is that I get a "lua52d.dll" (note the "d"). If I rename it, a "System.BadImageFormatException" is thrown by "KeraLua" (when I try with some "NLua.exe" executable I found in the "tests" folder of NLua).
Can anybody tell me how to build the modified lua52.dll required by NLua?
I already have a binary that works but need to be able to rebuild everything by myself. Possibly I'm simply using the wrong source tree.
You're using the right source tree, its just that you're compiling the debug version of the dll, not the release version of the dll. The added 'd' is to denote that it is the debug version of the dll, not the release version.

Installing haxe

I have a problem with programming in Haxe. Whenever I try to run a code, I get an error:
Please don't add haxe/std to your classpath, instead set HAXE_STD_PATH env var.
I tried to find a solution - according to multiple sites, I'm supposed to change the environment variable HAXE_LIBRARY_PATH to HAXE_STD_PATH and set the value to actual path to the std file in my haxe folder. In my case, there was no such variable among my env vars, so I made HAXE_STD_PATH as a new one - and I still get the same error.
I'm using FlashDevelop and when I try to search for any class that would reference std, I can see in Type Explorer that there is a classpath that leads straight to haxe/std, which should not happen IMO. I looked at classpaths in Properties and the path to std was not listed, so I could not change it.
So problem could be in the classpath or in FlashDevelop settings.
Did anyone have the same problem?
Oh, and BTW I'm using Windows - and yes, restarting did not help.
I removed all: FD including program settings and HaxeToolkit (the whole map).
Then I reinstalled FD, Haxe (using the apps window from FD), Lime and openFL (from command window).
Now I don't get this error anymore.

DllNotFoundException: libgfxunity3d

I'm new to unity and I am trying to use a plugin named Scaleform and I'm following the steps indicated in readme file, I've created a new project, imported the plugin, selected Main Camera object and attached the specified script to it, but when I want to play, I get this error:
DllNotFoundException: libgfxunity3d
SFCamera.OnDestroy () (at Assets/Plugins/SF/SFCamera.cs:163)
I googled and all I got was this: http://forums.autodesk.com/t5/Scaleform-Unity-Development/dll-not-found-exception/td-p/4242779
I've downloaded and installed DirectX too, but still no change! :(
Does anyone know what should I do?
Thanks!
We also ran into this problem on Windows. Ultimately, reinstalling the DirectX runtime did fix it for us (the person who had the problem was missing the d3dx9_43.dll that the Scaleform dll depends on).
You might also check and make sure you have put the right key into the appropriate location in your inherited camera script. (In the example, I believe it is called MyCamera.cs.)
Finally, you should check that your build target matches the version of the Scaleform trial you have installed. If your Unity build setting is Android, for example, you need to have the Android runtime for Windows, not the Windows runtime proper.
I downloaded the Depends application from http://www.dependencywalker.com/ and loaded libgfxunity3d.dll. I was missing msvcr100.dll, IEShims.dll and wer.dll. I threw those dlls into the System32 directory and my program ran great. Hope this helps!