x

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"

Strange Compile Errors

When I compile my program I get some errors I'm having trouble fixing. alt text

Lemme know what other information you might need and thanks in advance, I've been stuck on this for a while.

Product Version: UE 4.20
Tags:
error-log.png (187.2 kB)
file-log.png (45.1 kB)
file-log-2.png (41.9 kB)
more ▼

asked Feb 07 '19 at 07:46 AM in C++ Programming

avatar image

ThatsShocking
23 3 5 7

avatar image ThatsShocking Feb 07 '19 at 07:49 AM

Not all the images are being displayed, sorry about that; you can just click on the file names at the bottom of the question (e.g. "error-log.png") to display the images.

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

1 answer: sort voted first

error-log.png shows that there is a circular dependency in your project related to InventoryComponent.h. This means that some file includes InventoryComponent.h and that file in turn includes InventoryComponent.h. First try to find that file and remove the circular dependency and see if that resolves the errors.

more ▼

answered Feb 07 '19 at 08:31 AM

avatar image

Nikhil_04
26 3 2

avatar image ThatsShocking Feb 07 '19 at 11:44 AM

Thank you for the answer and timely response.

avatar image Nikhil_04 Feb 07 '19 at 12:27 PM

A general advice, Don't include header files directly into your headers if you are not allocating memory to the object, like if you are creating pointers. E.g. In your player class, you are creating pointer to UInventoryComponent but not allocating memory to it. So, instead of including InventoryComponent.h directly in your header, use a forward declaration and include the InventoryComponent.h in your .cpp file. That way these kind of errors can be avoided, plus it also reduces compilation dependencies.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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