Announcement

Collapse
No announcement yet.

Can't build basic plugin, C# build scripts treated as C++ sources

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can't build basic plugin, C# build scripts treated as C++ sources

    I've been having trouble tracking down why I can't build downloaded C++ projects, and I decided to learn more about the plugins system as both projects I've attempted have used them.

    Turned out to be the right place to look, as I've found myself unable to compile even the most basic of plugins. I'm following this tutorial on the wiki, and the first plugin containing nothing appears just fine. But after creating the second plugin, launching the editor prompts a recompile. Completely expected, except that the build fails. Again with no indication why. You can view the compilation log while it's compiling, but as soon as there's a failure it vanishes and you're greeted with this incredibly helpful dialog:

    Click image for larger version

Name:	FbXYwxD.png
Views:	1
Size:	3.6 KB
ID:	1138667

    Alright. So let's open it up in Visual Studio (I've been just using a text editor to create the plugin so far) and see what the problem is:

    Click image for larger version

Name:	7nkOPjV.png
Views:	1
Size:	74.5 KB
ID:	1138668

    I see. "#using UnrealBuildTool;" is invalid C++ syntax, so it fails out. Which is to be expected since it's C# syntax in a .cs file that the build tool should be opening as a C# source file.

    What do I do here? Has the process changed since the tutorial was written? Because this looks just like the structure of the 4.4 project I was having trouble with earlier. I've tried this in 4.4 and 4.3, both from the launcher.
    Last edited by Veovis Muad'dib; 09-19-2014, 10:26 AM. Reason: Fixed title

    #2
    Delete the # in front of both using, it shouldn't be there. The correct syntax is:

    Code:
    using UnrealBuildTool;
    using System.IO;
    These statements tell tell the C# compiler which external modules are referenced.

    Comment


      #3
      Originally posted by jCoder View Post
      Delete the # in front of both using, it shouldn't be there.
      I was a C# developer for years before moving over to C++ in Unreal. It's been only two months.... I'm ashamed of myself. :\

      Thanks.

      Comment

      Working...
      X