I’m trying to add a new C++ class to a project in 4.12.5 on OSX, I use the File - New C++ Class command and choose the ‘None’ parent class (I’m creating a Data Table to import a .csv file) and give the class a name. The engine then goes through the ‘compiling’ process and when XCode opens I enter the code into the .h file and save everything within XCode. I then switch back to UE and press the Compile button in the editor and nothing happens. I’ve restarted the engine and still nothing.
I’ve tried this in an existing project and an new empty one and get the same thing.
What exactly did you change in the class after adding it? Since you used “None” as the parent, there is no UCLASS() macro by default so the class is not “seen” by the editor. When I changed the class files to more closely resemble the header/source of a default actor class, the class showed in the C++ section of the content browser and creating a blueprint from the class had the variable defaults set in code.
Hi .
It’s not looking as though XCode is as easily integrated as VS (unfortunately!).
I’ve edited the class and resaved, but the Compile button still doesn’t do anything.
I’ll have a go at compiling the project within XCode, but my first attempt produced a build fail - maybe there’s some options that need changing?
Thank you for providing your set up. I plan to create a test case on my end, however there are a couple other questions I’d like to ask based on your response to McStrife. What is your expectation when you use the compile button that isn’t occurring (so I know what behavior to look for in my test). Also, if you try to compile in XCode and get compile errors there, then I would not be surprised that the in editor compile button is not having any affect. If the code is unable to compile in the IDE, then it will fail to build using the in editor as well. Please provide the exact error you’re getting when trying to compile in XCode for additional information.
Hi ,
When I press the Compile button, I’d expect to see the editor attempt to compile the code and then for it to produce a response, either a fail or success confirmation (as experienced in previous versions of UE and on Windows when using VS to write code).
As for the error I get in XCode - If I Build I get these errors:
"MyProject3_Build Group
- /admin/Documents/Unreal Projects/MyProject3/Source/MyProject3/DialogueDataTable.h
--- ../../../../../admin/Documents/Unreal Projects/MyProject3/Source/MyProject3/DialogueDataTable.h:18:5: error: unknown type name 'Engine_Source_Runtime_Slate_Public_Framework_Views_ITypedTableView_h_18_GENERATED_BODY'
--- ../../../../../admin/Documents/Unreal Projects/MyProject3/Source/MyProject3/DialogueDataTable.h:21:14: error: expected ';' at end of declaration list
- /Users/admin/Documents/Unreal Projects/MyProject3/Intermediate/Build/Mac/UE4Editor/Inc/MyProject3/MyProject3.generated.cpp
--- /Users/admin/Documents/Unreal Projects/MyProject3/Intermediate/Build/Mac/UE4Editor/Inc/MyProject3/MyProject3.generated.cpp:12:41: error: out-of-line definition of 'StaticStruct' does not match any declaration in 'FDialogueTableRow'
--- /Users/admin/Documents/Unreal Projects/MyProject3/Intermediate/Build/Mac/UE4Editor/Inc/MyProject3/MyProject3.generated.cpp:24:106: error: call to non-static member function without an object argument
--- /Users/admin/Documents/Unreal Projects/MyProject3/Intermediate/Build/Mac/UE4Editor/Inc/MyProject3/MyProject3.generated.cpp:53:152: error: no member named 'Wav' in 'FDialogueTableRow'
Class.h
— /Users/Shared/UnrealEngine/4.12/Engine/Source/Runtime/CoreUObject/Public/UObject/Class.h:874:39: error: incomplete definition of type 'TElementAlignmentCalculator'
If there’s errors in the C++ code then that’s fair enough (my bad!), although I would expect the Compile process in UE to throw up the same errors rather than appear to do nothing.
However, this code does work on a Windows machine - so is there some difference in coding for UE between Windows and OSX?
Adding the struct you provided to a code class created as described earlier (parent of None during creation) was giving me compile errors for both Windows and Mac. When I added : public AActor to the class [PROJECTNAME]_API DialogueDataTable line the code was able to compile successfully along with the the struct. With this change let me know if you’re able to successfully compile on your end.
Hi ,
I’ve added the suggested, but still got the same set of errors when attempting to build within XCode.
Just for clarification, my code is now:
// Fill out your copyright notice in the Description page of Project Settings.
I realized the reason for my compile errors was due to a missing include statement for [ClassName].generated.h. In the code snippets provided so far I have not seen a generated.h in your code either, which may be causing the compile issue.