I am experiencing problems with creating a new plugin, which I think might be caused by an error in my approach. I am hoping someone more experienced might point out the step I am missing.
Create new UE5 project, with C++ enabled
View Plugins list, Add, New, fill out the form, click Create - from the templates, I am not sure which is for C++, GUI less, shows up in Blueprints, so perhaps Basic one
Find solution file, click to open VS20xx - it seems to default to 2019, but I have VS2022 installed
Older project, SDK, would you like to update? v143 tools, 10.latest, okay
In Solution view, change to ShowAllFiles - there is no directory view here
Open FileExplorer in the newly created project - find the Public/Private folders
Cut and paste in .cpp and .h files from my numerous previous attempts, about 10 files, based off a working plugin, with mods
Open the pasted files, and adapt them to wotk with the newly created plugin name
Files show 11000 errors in Intellisense, cannot locate headers (even basic ones), cannot locate any generated.h files, cannot jump to declarations or definitions
Compile from source code - says it’s done it, not convinced
Try running UE5 - if it works, then the plugin is not in use; if it does not, it says the project was built in a different version, compile from source, does not work
All paths end here. Rip the added .cpp and .h files out, go around again with a new project and new plugin, altering something else.
Things I have tried include adding the public and private paths in the build.cs file.
Deleting projects, working in VS2019, or VS2022. Hand editing vxproj files.
The list goes on.
The cut/pasted files seem not to be in any kind of path that Visual Studio can use to work out whether the code is valid or not. Without Intellisense, it is practically impossible to code. Build errors usually just moan about UE5 live coding, so kill that, recompile, and it throws linker errors.
Searched out YouTube videos, but nothing seems to shed light. I assume this is mostly about build system and source library paths while developing in VS20xx. Where are these set?
This has consumed 4days of time to this point, and I could use some suggestions. Anything I may have missed?
I am still getting #include “ano.h” is not found - it’s in the same folder as the file I am editing. Is Intellisense that far out of whack, it cannot find an adjacent file? Or is there some magic to getting plugin source files in the path of the plugin development. The ones added by the create process are fine - it’s my cutnpastes that are playing up.
They are visible in the filters. They were added by “Add Existing” in VS.
The solution I tried is the one in the 2nd to last post, setting the Source Code editor to VS 2022. That seems to have got it working for me…
(I’m using community edition too)
Another thing I decided to do was to add a separate list of local includes - eg. "#include “…/public/ano.h” and //#include “ano.h” so Intellisense has an easier time of it, at least while I am editing. These can easily be commented/swapped for the build step. This has got rid of a lot of the red line problems, and restored some sanity to the basic business of not making such grevious typos, something it seems I have learned to do quite spectacularly of late…
Still wrestling with mystery messages though - of the “this class has already been defined” variety - which is just bizarre. I have read it has something to do with constructors and GENERATE_BODY() macro, but I have yet to solve it. Probably better in another forum thread, else we head OT.
I tried to get the project to load to change the setting in the editor, and had to launch a new project to find the setting. I got as far as updating the Visual Studio and the default to VS2022. However, I hit the same issue as I have done repeatedly - the project in which I am editing the plugin code will not launch, as it says it was built with a different version, and that I should try to build it instead from the source code. This brings me back full circle. I cannot get VS2022 intellisense working until after I have got it to compile, which is a circular scenario.
Unless there is a python macro hiding in there somewhere which updates the project to VS2022 compatibility without the annoyance of having to have a working solution in the first place.
Logically, I could remove my plugin code, and go around again, with yet another new project. Think this would be project no 8, so that is bordering on circular too… Whatever works.
And who said development was a game of patience…