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"

C++ project compile errors

I am working on my first project and using C++ to do some work. When I try to build the C++ project I get several errors including UMaterialInstanceConstant* cannot be converted to UMaterialInterface, FActorSpawnParameters is not defined, GEngine is not defined, World is an incomplete class type and cannot be used. If I comment out the line associated with the first issue, and do a full rebuild the build will succeed. But just building causes these errors. I assume that there is something missing from my project but I cannot figure out what?

Any ideas on the causes of these issues?

Thank you

Product Version: UE 4.16
more ▼

asked Jul 19 '17 at 06:42 PM in C++ Programming

avatar image

3 2 3

avatar image ColdSteel48 Jul 19 '17 at 06:47 PM

Hi, it is very hard to help you without seeing the actual code. Some of the errors probably means that you are missing some include files.

avatar image MichaelBesselman Jul 19 '17 at 07:28 PM

That is what I thought with the includes but why would it work with a full rebuild and not a regular build?

As for the code to include not sure what or how much to add here.

I have 2 classes one for the game board and one for pieces. The Grid class has the following includes: #include "GamePiece.h" #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "TicTacToeGrid.generated.h"

My Game Piece class has:

include "CoreMinimal.h"

include "PaperSpriteActor.h" #include "GameFramework/Actor.h" #include "GamePiece.generated.h"

I tried to change CoreMinimal to Core and that did not work. I also tried to include World but that gave more errors.

avatar image ColdSteel48 Jul 19 '17 at 08:11 PM

I suppose your classes are not inheriting UObject ? To narrow down some errors - try to #include "Engine.h"

avatar image MRVRMAN Dec 24 '17 at 12:19 AM

Your solution helped me thanks

avatar image MichaelBesselman Jul 19 '17 at 11:52 PM

That actually resolved all of these problems. Now I get a message 'identifier "FDrawingPolicyRenderState" is undefined' about 80% of the time when I build. If I rebuild the solution than everything works well.

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

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question