The-Chinese-Room / Inkpot

Inkpot - a container for Ink
MIT License
168 stars 18 forks source link

Compilation errors due to INK_DBG #20

Closed HighTeaFrog closed 1 year ago

HighTeaFrog commented 1 year ago

Hello,

First of all, thank you so much for sharing this repo, it'll be incredibly useful to us as we are moving engine with a project which was making extensive use of Ink, and it spares me the time of having to rewrite Ink in CPP myself!

Unfortunately, when trying to compile the plugin, I get quite a few errors due to the INK_DBG macro uses in InkpotStory.cpp. I can comment them all and it works fine then.

I'm on UE5.3.

Here's the compilation log after uncommenting one of the line, if I uncomment more it basically duplicates that for the other lines:

 [1/1] Compile [x64] Module.Inkpot.cpp
  D:\PerforceWorkspace\UnrealProjects\X\Plugins\Inkpot\Source\Inkpot\Private\Inkpot\InkpotStory.cpp(345): error C3688: invalid literal suffix 'msg'; literal operator or literal operator template 'operator ""msg' not found
  D:\PerforceWorkspace\UnrealProjects\X\Plugins\Inkpot\Source\Inkpot\Private\Inkpot\InkpotStory.cpp(345): error C3553: decltype expects an expression not a type
  D:\PerforceWorkspace\UnrealProjects\X\Plugins\Inkpot\Source\Inkpot\Private\Inkpot\InkpotStory.cpp(345): error C2062: type 'unknown-type' unexpected
  D:\PerforceWorkspace\UnrealProjects\X\Plugins\Inkpot\Source\Inkpot\Private\Inkpot\InkpotStory.cpp(345): error C2955: 'TIsArrayOrRefOfTypeByPredicate': use of class template requires template argument list
  D:\UE_5.3\Engine\Source\Runtime\Core\Public\Templates\IsArrayOrRefOfTypeByPredicate.h(13): note: see declaration of 'TIsArrayOrRefOfTypeByPredicate'
  D:\PerforceWorkspace\UnrealProjects\X\Plugins\Inkpot\Source\Inkpot\Private\Inkpot\InkpotStory.cpp(345): error C2661: 'UE::Logging::Private::FStaticBasicLogRecord::FStaticBasicLogRecord': no overloaded function takes 4 arguments
  D:\PerforceWorkspace\UnrealProjects\X\Plugins\Inkpot\Source\Inkpot\Private\Inkpot\InkpotStory.cpp(345): note: while trying to match the argument list '(const char *, int, ELogVerbosity::Type, UE::Logging::Private::FStaticBasicLogDynamicData)'
  D:\PerforceWorkspace\UnrealProjects\X\Plugins\Inkpot\Source\Inkpot\Private\Inkpot\InkpotStory.cpp(345): error C2131: expression did not evaluate to a constant
  D:\PerforceWorkspace\UnrealProjects\X\Plugins\Inkpot\Source\Inkpot\Private\Inkpot\InkpotStory.cpp(345): note: a non-constant (sub-)expression was encountered

I didn't do anything apart from adding the plugin to my Plugins folder, and enabling it in Unreal.

Thanks,

Clem

SixParQuatre commented 1 year ago

+1 on this, upon restarting a 5.3.0 project after enabling the plugin, a dialog request a recompilation of the plugin: image and then it fails: image This also happens when trying to open the inkpot demo project from the other repository.

TCR-Nick commented 1 year ago

This is now fixed. Cpp20 is a little more strict on string concatenation in macros, this turned out to be a missing space.

TCR-Nick commented 1 year ago

@SixParQuatre, I think you need to compile the source. No binaries are provided by default, you will need to compile them. & now this fix is in you will be able to compile.

SixParQuatre commented 1 year ago

@TCR-Nick I tried again by pulling latest and I'm still getting the same errors. This happens both:

  1. by using Inkpot repo @commit aa445f2 that I copied in my own project
  2. by opening InkPotDemo project @commit a28ff9c (with Inkpot submodule pointing at commit 871403f)

The log mentions:

Microsoft platform targets must be compiled with Visual Studio 2022 17.4 (MSVC 14.34.x) or later for the installed engine. Please update Visual Studio 2022 and ensure no configuration is forcing WindowsTargetRules.Compiler to VisualStudio2019. The current compiler version was detected as: 14.29.30147
LogInit: Warning: Still incompatible or missing module: InkpotDemo

I've installed the VCRedist mentioned in the Readme; but I don't have Visual Studio 2022 installed (I'm still on 2019); is that needed?

TCR-Nick commented 1 year ago

@SixParQuatre Yes, 5.3 drops support for older compilers, you will need to install Visual Studio 2022.

SixParQuatre commented 1 year ago

@TCR-Nick

Ok, cool after getting all the necessary bits from Visual Studio 2022; I got some good and bad news :)

Good news: I managed to run the Inkpot Demo project and rebuilding worked perfectly, and I've run the test scene successfully. I think you should amend the Requirements and since I just went through the steps; I thought I'd write the blurb

Download Visual Studio 2022 and run it. You will need 3+Gb of free space for this. During installation, in the Individual Components tab, search for "MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)" and tick it.

I would also add a section on how to use the plugin for peeps who are more used to the marketplace like me :P); it's probably a good idea to have them either unzip or make a repo underUEInstallFolder\Engine\Plugins\Markeplace\Inkpot so that the plugin can be found through the Plugin window in any project.

As a note, it feels a bit at odds with accessibility that one would need to have to install 3+Gb of coding tools to use a plugin that aims at not having to interact with C++; any plan on bundling the binaries soon?

Bad News: when using the latest commit of Inkpot (aa445f2); and putting it in my own project, it fails to build; after using the command line to try and build it, it returns the following errors (I used the subfolder UE3_5 for the -package argument):

[...]\Inkpot\UE5_3\HostProject\Plugins\Inkpot\Source\Inkpot\Public\Inkpot\InkpotChoice.h(31): Error: An explicit Category specifier is required for any property exposed to the editor or Blueprints in an Engine module.
[...]\Inkpot\UE5_3\HostProject\Plugins\Inkpot\Source\Inkpot\Public\Inkpot\InkpotChoice.h(34): Error: An explicit Category specifier is required for any property exposed to the editor or Blueprints in an Engine module.
[...]\Inkpot\UE5_3\HostProject\Plugins\Inkpot\Source\Inkpot\Public\Asset\InkpotStoryAsset.h(32): Error: An explicit Category specifier is required for any property exposed to the editor or Blueprints in an Engine module.
[...]Inkpot\UE5_3\HostProject\Plugins\Inkpot\Source\Inkpot\Public\Asset\InkpotStoryAsset.h(35): Error: An explicit Category specifier is required for any property exposed to the editor or Blueprints in an Engine module.
[...]Inkpot\UE5_3\HostProject\Plugins\Inkpot\Source\Inkpot\Public\Inkpot\InkpotWatch.h(34): Error: An explicit Category specifier is required for any property exposed to the editor or Blueprints in an Engine module.

The submodule of Inkpot inside the InkpotDemo repo seems to be a few commits behind origin/HEAD (871403f).

I hope all these feedbacks are OK and thanks for the work so far!

SixParQuatre commented 1 year ago

Oh and one other quick things, since you're not providing binaries, you should add the Binaries, Saved and Intermediate subfolders to gitignore.

TCR-Nick commented 1 year ago

@SixParQuatre

Thanks for the feedback :)

I'll look into distributing the binaries, but for the moment it will be source only. Binary distribution will most likely be via the marketplace so that it can be truly plug and play.

Adding Visual Studio as a requirement is on the list of things to do, so expect this to come shortly.

Finally thanks for reporting the errors when using as an engine plugin. This has been written as an application plugin, so it's likely there will be a few things to sort if people want to use as an engine plugin.

The changes to the submodule won't affect the demo project, but I will update the demo to have the latest in the next day or so,

SixParQuatre commented 1 year ago

Finally thanks for reporting the errors when using as an engine plugin. This has been written as an application plugin, so it's likely there will be a few things to sort if people want to use as an engine plugin.

Right, in that case, it would be good to add a section in the documentation on how to add the plugin to an existing project without it being an 'engine plugin' ; because I followed the first direction found on google that made me just copy/paste the hierarchy under a Plugins/Inkpot subfolder and that failed to recompile on start with the latest commit.

HighTeaFrog commented 1 year ago

It's solved for me, thank you very much!