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"

Cannot compile nor open project in unreal

Hey there, begginer here. Placed a door, trigger volume that opens it after you go over it by adding a c++ component. Works great, but when I add another trigger behind the door that is supposed to close it and type the code for it it won't compile or even open in Unreal Engine anymore.

I have tried: rewriting the code, restarting my pc, repairing/reinstalling both Visual Studio and Unreal Engine, mess around with NMake paths (not sure what I did anymore its been a week+ of trying whatever I could. I would appreciate every info, or advice on what to include here to make it easier for you to see whats wrong. My code: .h cpp

VS build output: BuiltOutput

Error screenshot: alt text

My VS version: 15.4.3

Please help and thanks for your time

Product Version: UE 4.17
errors.png (123.4 kB)
more ▼

asked Nov 11 '17 at 05:02 PM in C++ Programming

avatar image

8 1 3 5

avatar image Lobotomiac Nov 11 '17 at 05:35 PM

Thanks people! Good advice and I will. Thank you so much once again!

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

2 answers: sort voted first

your close door method is incorrect.

First you have written it as: "void UCloseDoor ()" which is also misleading with the c'tor - but VS seems to overcome this.

change your line 28 in CPP to this one.

 void UCloseDoor::CloseDoor()

Advice for future - Pick a better Class and Method names!

more ▼

answered Nov 11 '17 at 05:11 PM

avatar image

537 6 20 23

avatar image Lobotomiac Nov 11 '17 at 05:36 PM

Thanks! looks like I have a lot to learn!

avatar image ColdSteel48 Nov 11 '17 at 05:38 PM

When speaking about C++ every one has a lot to learn - Sometimes it feels that Bjarne is the only one who knows what is going on there.

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

Hey there Lobotomiac,

From the log looks like it's a very simple issue to solve, but I wanted to point out a few tips before giving you the answer:

  • Do not even waste your time looking at the Error Output window, close that because it's not going to help you when using Unreal, instead keep using the output log just like you did right there.

  • Try to assign nullptr instead of the NULL macro, it just sticks to the UE4 coding standard

  • Keep a close look at the error code, you can easily find the issue if you read closely

Now the issue is on CloseDoor.cpp(31): error C3861: 'GetOwner': identifier not found.

Looks like you are trying to access GetOwner from the Pawn/Character? (just my guess because the issue is on the .cpp not on the header). What comes to my head is that you are not including the header file from the Pawn you are calling this function on thus the compiler doesn't know anyhing about a GetOwner().

If you ever need more help I'll drop you a link to an useful discord chat with a community of devs that can help you with these issues as well: http://unrealslackers.org/

Hope this helps!

more ▼

answered Nov 11 '17 at 05:19 PM

avatar image

361 16 17 25

avatar image ColdSteel48 Nov 11 '17 at 05:20 PM

No, just look at line 28 in C++

and you will immediately see whats wrong.

The identifier not found - because on line 28 there is a function declared - and not an implementation of the desired method.

The function has nothing to do with class methods, it is just a plain C function. So GetOwner is not related to the AActorComponent and thus undefined.

avatar image virtual_nomak Nov 11 '17 at 05:22 PM

oh I didn't notice he shared the .cpp

avatar image ColdSteel48 Nov 11 '17 at 05:29 PM

'+1' with remark "nullptr is a C++ coding standards while NULL is visual studio only :)".

avatar image Lobotomiac Nov 11 '17 at 05:36 PM

Thanks a million!

(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