
Announcement
Collapse
No announcement yet.
c++ #include error
Collapse
X
-
cmartel repliedSquiggles (i.e.: IntelliSense errors) are often wrong or out of date. While they are useful when they do work, don't ever rely on them as actual "errors". Compile the project and that will tell you if you do have any errors.
In this particular case, a freshly created class will not have a header generated since that happens on a full compile. So "Weapon.generated.h" being underlined is irrelevant until you compile first.
Leave a comment:
-
Folgad0 replied -
cmartel repliedI think your header tool is trying to say something. It might be worth following its directives.
Leave a comment:
-
Folgad0 replied -
oasf repliedThere has been some changes with the introduction of the GENERATED_BODY macro. If you want to follow the tutorial with no hassle, change GENERATED_BODY() to GENERATED_UCLASS_BODY().
Then you will use constructors etc. the old way, like the tutorials.
Without seeing more of your code, I can only assume that this is the cause...
Leave a comment:
-
Slayemin repliedYour post came out malformed. Can you repost it with the code you're using and the error messages you're getting?
Thanks.
Leave a comment:
-
Folgad0 repliedhmm , ok so i made new project, followed tuturial , and copied ur code. most of things are goood only this now:
Code:#include "Pickup.generated.h" /** * */ UCLASS() class TUTORIALCODE_API APickup : public AActor { GENERATED_BODY()
Any idea ?
Leave a comment:
-
Folgad0 repliedha ya , i noticed that and i actually changed it. And still gives me the errors...
Ill just create new project with same name as you ,and ill see if works
Thanks for the help so far everyone
Leave a comment:
-
Slayemin repliedOriginally posted by Folgad0 View PostBtw what do you mean with
B) Change your #include to your .H file
I dont understand
You have a line at the top of your code which says: #include "TutorialCode.h" and that's pointing to a file which doesn't exist. Instead, you can change that to point to your header file by writing: #include "TuturialThirdPerson.h" which should exist (based off of the screenshots I saw).
Leave a comment:
-
Slayemin repliedFair enough. Did you get the code to compile without errors after my suggested fix?
Leave a comment:
-
Folgad0 repliedBtw what do you mean with
B) Change your #include to your .H file
I dont understand
Leave a comment:
-
Folgad0 repliedand also i know tuturial is misspelled, everything is tuturial for me (im not english easier)
Leave a comment:
-
Slayemin repliedYeah... so, the problem is that your project is named "TuturialThirdPerson" (which has a misspelling, btw). Mine was called "TutorialCode".
When I created my project, the "tutorialcode.h" file was pregenerated and included in the project. You probably have a "tuturialThirdPerson.h" file somewhere. You need to change this. You have a few options:
A) Rename the "tuturialthirdperson.h" file to "tutorialcode.h"
B) Change your #include to your .H file
C) Create a new project called "TutorialCode" (to perfectly reflect the demo videos and avoid future translation mistakes)
What's happening?
Well, the pregenerated file has:
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#ifndef __TUTORIALCODE_H__
#define __TUTORIALCODE_H__
#include "EngineMinimal.h"
#endif
Leave a comment:
Leave a comment: