Cannot distribute c++ Code in Plugin

Here is my process:

  • Download zip of source (4.6.1, e.g.) from GitHub
  • Build the “Development Editor” win64 build of my c++ plugin.
  • Install 4.6.1 from Launcher
  • Copy the following files in the locations shown below:

C:\Program Files\Epic Games\4.6\Engine\Plugins\Developer\MacTalonPlugin\MACTalonPlugin.uplugin

C:\Program Files\Epic Games\4.6\Engine\Plugins\Developer\MacTalonPlugin\Binaries\Win64\UE4Editor-MACTalonPlugin.dll

C:\Program Files\Epic Games\4.6\Engine\Plugins\Developer\MacTalonPlugin\Resources\Icon128.png

C:\Program Files\Epic Games\4.6\Engine\Plugins\Developer\MacTalonPlugin\Source\MACTalonPlugin\Classes\MACPluginObject.h

C:\Program Files\Epic Games\4.6\Engine\Plugins\Developer\MacTalonPlugin\Source\MACTalonPlugin\Public\MACTalonPlugin.h

  • Copy our SDK client DLL into C:\Program Files\Epic Games\4.6\Engine\Binaries\Win64 (plugin requires this dll)

Plugin works fine in Dev tree with engine built with plugin, version:
4.6.1-0+UE4

Running with launcher installed version (4.6.1-2386410+++depot+UE4-Releases+4.6) gives “The following modules are missing or built with a different engine version:
UE4Editor-MACTalonPlugin.dll
Would you like to rebuild them now?”

THIS PROCESS WORKED FINE with the source version 4.2.1 and the launcher installed 4.2.1, but all versions after that run fine in build tree version but don’t run in launcher installed editor version. (I tried 4.4.2 and 4.4.3 in addition to 4.6). The code only changed due to API changes (i.e. change OVERRIDE to override) to compile successfully.

I have tried removing all the source based on notes in the plugins documentation, that makes no difference. I have tried all kinds of changes to the uplugin file (different version numbers, no EngineVersion entry, remove all “optional” entries, etc) to no avail.

I have tried 2 different versions of Zip development download (UnrealEngine-4.6.1-release.zip on 12/30 and UnrealEngine-4.6.zip on 12/22) to no avail.

At this point, I have a working plugin which streams motion capture data onto a blueprint character that I cannot distribute to customers who want to use the current version of UE4.

HELP!

Thanks in advance for any help provided.

#Git and Release Stopped Being Binary Compatible After 4.3

Dear ,

The Github and Release engine versions stopped being binary compatible back in 4.3! I experienced this while working on Solus.

That means its possible you just need to build your plugin with the release version of the engine, rather than your github build.

You can create a C++ game of any template using the release build, move your plugin code over, and move your custom dll into the release version of the engine/Binaries/Win64!

Once you compile your plugin using the 4.6.1 Release C++ game project, THEN the plugin should work great with release version of UE4 4.6.1 !

#Questions for you

a. Can you build your plugin in the public release version of UE4, in Development (prior to packaging)

Please not I am not asking you if you can run your plugin that you built with Git in release UE4, I already know that is not likely to work!

I am stating it is most likely a requirement that you build your plugin using a C++ project that is part of the standard UE4 public release version!

Please try that !

b. If you can do (a), and actually re-build your plugin in a sample C++ UE4 project using release version of Editor, can you then take this plugin and use it in a BP-only project that also uses release version?

#Friendly Reminder About Packaging Custom Dlls
If you package the game, make sure to include your custom .dll in the packaged game Engine/Binaries/Win64!

#:heart:

Hi ,

Thanks so much for your quick reply!

I’m not sure how to build in the distributed version of the engine. I have used the generateprojectfiles.bat to create a visual studio project in the git-hub tree, and there is no equivalent in the “Program Files” version. I build the entire engine, and my plugin is built in that process.

What would the steps be to move my plugin source and build in the other tree? Sorry, the build system is a bit confusing to me to begin with!

This is not a game, but rather a Code-In plugin to use with the editor.

#Building Plugin For Public Release Engine

“What would the steps be to move my plugin source and build in the other tree?”

Well hmmm, you can’t build the public release engine, so your plugin code needs to be moved to the project-level!

This shouldn’t be an issue though!

My Vertex Snap plugin is entirely a in-editor plugin, but I build and distribute it to people at the project-level.

Are you modifying any Engine files? If yes, then every client needs a custom UE4 Git build.

If you are not modifying the Engine, follow these steps

a. move that dll that your plugin depends on to the Release version of the engine/Binaries/Win64/ as you did for github version

b. Make a C++ project in the public release 4.6.1, third person template.

c. Add a folder to this project called “Plugins”

d. Move your plugin code over to this directory.

e. Compile this project

f. See my original post/questions/progressive steps to test whether it worked

I use my Editor plugin, compiled at the project level, all the time! You should be set as long as you are not modifying Engine files, and only need that .dll you mentioned

Clients should just add your plugin to their own projects at the project level.

:slight_smile:

#Make a C++ Project

Open the release version of the Editor, when it shows the launcher where you can choose a project, select new project, and make sure it is a C++ project

or if a project loads, go to File->NewProject

Again Make sure to select C++ project

then choose the third person template

You can set it to not include starter content, which is almost 1gb of stuff.

Then when your new template finishes, you will be taken to VS 2013 to compile your new project

Compile your new project, make sure it works!

Then add the directory “Plugins” to your new project’s root directory where the .uplugin is

Add all your plugin code inside of this new Plugins folder

recompile your project

Now see rest of my comments to flesh out the rest!

:slight_smile:

I’m not modifying any engine code. I downloaded and looked at your plugin source. When you say “third person template” do you mean
C:\Program Files\Epic Games\4.6\Templates\TP_ThirdPerson?

When you say “Make a C++ project”, do you mean a create a .sln or .vcxproj file? When you say “Compile this project”, do you mean using VS2013 or via the UE4 editor?

Can I put your source into the release tree somewhere and build it? How would I do that?

Thanks again for your helpful responses!

I’m making progress, I had to re-install the release version of UE4, it would not create a c++ project! Now it does, I followed your steps thru d. I had some external libs I needed, and figured out how to add those includes and libs successfully, but now I’m getting errors like this:

1> PCH.MACTalonPlugin.MACTalonPluginPrivatePCH.h.cpp
1>c:\program files\epic games\4.6\engine\source\runtime\core\public\stats\Stats2.h(1173): error C2039: ‘MemoryBarrier’ : is not a member of ‘FWindowsPlatformMisc’
1> c:\program files\epic games\4.6\engine\source\runtime\core\public\Windows/WindowsPlatformMisc.h(29) : see declaration of ‘FWindowsPlatformMisc’

and this:

C:\Program Files\Epic Games\4.6\Engine\Source\Runtime\SandboxFile\Public\IPlatformFileSandboxWrapper.h(262): error C3668: ‘FSandboxPlatformFile::DeleteFile’ : method with override specifier ‘override’ did not override any base class methods

I’m thinking it’s related to including windows.h (after MinWindows.h), and am looking at how to deal with this. This isn’t a problem with my git-hub build, so I know there must be a way to fix it…

Any ideas?

sound like API changes to me, download the Github version of 4.6.1 if you dont have it already, and look thru the source code to see how the functions have changed :slight_smile:

This code builds and runs on two different git-hub downloads of 4.6.1, I think it’s different build settings generated by UE4 when creating the project. There are a number of differences in the build defines that I’m looking at.

, Thanks so much for your help! I did manage to get a build that works with the distributed release using your methods, plus a bit of build manipulation and a bit of cheating…

What you suggested got me most of the way there, but I had to take the define settings from the git-hub build and use them in the project level build, and also I ended up modifying some h files in the release to eliminate build errors related to file functions (which I’m not using, fortunately).

To address some compile errors, I changed WindowsPlatformMisc.h to include the line:
static void MemoryBarrier();

and commented out some of the file functions that caused compile errors in IPlatformFileSandboxWrapper.h:

//Result = LowerLevel->MoveFile( *ConvertToSandboxPath( To ), *SandboxFilename );

//Result = LowerLevel->CopyFile( *ConvertToSandboxPath( To ), *ConvertToSandboxPath( From ) );

//return LowerLevel->CreateDirectory( *ConvertToSandboxPath( Directory ) );

which I suppose aren’t windows compatible calls. I hate changing source in an API, but it works, and I really needed to get this plugin into my customer’s hands!

Thanks again!