Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

[Closed] How do I declare a DataTable USTRUCT?

I'm having some trouble trying to declare a USTRUCT for use with a data table. I'm attempting to follow the tutorial on the wiki, but I'm stuck :P

This is my code:

 #pragma once
 #include "Engine/DataTable.h"
 #include "ItemDataTable.generated.h"
 class MYGAME_API UItemDataTable : public UDataTable
     struct FItemData : public FTableRowBase

The compiler throws this error:

 1>------ Build started: Project: MyGame, Configuration: Development_Editor x64 ------
 1>  Parsing headers for MyGameEditor
 1>LogTextLocalizationManager : warning : The selected culture 'sv_SE' is not available; falling back to 'en'
 1>  Reflection code generation finished for MyGameEditor and took 4,176
 1>  Performing 3 actions (max 6 parallel jobs)
 1>  ItemDataTable.cpp
 1>  MyGame.generated.cpp
 1>F:\Unreal Engine\Unreal Projects\MyGame\Intermediate\Build\Win64\Inc\MyGame\MyGame.generated.cpp(27): error C2653: 'FItemData' : is not a class or namespace name
 1>F:\Unreal Engine\Unreal Projects\MyGame\Intermediate\Build\Win64\Inc\MyGame\MyGame.generated.cpp(37): error C2653: 'FItemData' : is not a class or namespace name
 1>F:\Unreal Engine\Unreal Projects\MyGame\Intermediate\Build\Win64\Inc\MyGame\MyGame.generated.cpp(301): error C2065: 'FItemData' : undeclared identifier
 1>F:\Unreal Engine\Unreal Projects\MyGame\Intermediate\Build\Win64\Inc\MyGame\MyGame.generated.cpp(301): error C2923: 'UScriptStruct::TCppStructOps' : 'FItemData' is not a valid template type argument for parameter 'CPPSTRUCT'
 1>F:\Unreal Engine\Unreal Projects\MyGame\Intermediate\Build\Win64\Inc\MyGame\MyGame.generated.cpp(301): error C2512: 'UScriptStruct::TCppStructOps' : no appropriate default constructor available
 1>F:\Unreal Engine\Unreal Projects\MyGame\Intermediate\Build\Win64\Inc\MyGame\MyGame.generated.cpp(301): error C2664: 'UScriptStruct::UScriptStruct(const UScriptStruct &)' : cannot convert argument 1 from 'FPostConstructInitializeProperties' to 'EStaticConstructor'
 1>          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
 1>  -------- End Detailed Actions Stats -----------------------------------------------------------
 1>ERROR : UBT error : Failed to produce item: F:\Unreal Engine\Unreal Projects\MyGame\Binaries\Win64\UE4Editor-MyGame.dll
 1>  Cumulative action seconds (6 processors): 0,00 building projects, 8,89 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,00 linking, 0,00 other
 1>  UBT execution time: 18,59 seconds
 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ""F:\Unreal Engine\4.4\Engine\Build\BatchFiles\Build.bat" MyGameEditor Win64 Development "F:\Unreal Engine\Unreal Projects\MyGame\MyGame.uproject" -rocket" exited with code -1.
 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Product Version: Not Selected
more ▼

asked Aug 07 '14 at 10:28 AM in C++ Programming

avatar image

808 39 30 66

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Aug 07 '14 at 05:18 PM by Jargon for the following reason:

Resolved it myself. I deleted the class definition and moved the struct out.

0 answers: sort voted first

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question