Announcement

Collapse
No announcement yet.

c++ #include error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    I solved all my problems .. Tough time But thank you all

    Leave a comment:


  • replied
    Squiggles (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:


  • replied
    I just noticed , that everytime i create a new project (c++ code) , and create an actor i alway have errors , without changing anything.

    Here is an example : Click image for larger version

Name:	erro.png
Views:	1
Size:	124.3 KB
ID:	1064229

    Leave a comment:


  • replied
    I think your header tool is trying to say something. It might be worth following its directives.

    Leave a comment:


  • replied
    Ok, here is the screen shot

    Click image for larger version

Name:	error 4.png
Views:	1
Size:	135.2 KB
ID:	1064217

    and now this one

    Click image for larger version

Name:	error 4.png
Views:	1
Size:	162.9 KB
ID:	1064218

    Also i have changed GENERATED_BODY() to GENERATED_UCLASS_BODY() and gives me the same errors :/

    Leave a comment:


  • replied
    There 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:


  • replied
    Your 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:


  • replied
    hmm , 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()
    This is the error it self , the rest is good


    Any idea ?

    Leave a comment:


  • replied
    ha 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:


  • replied
    Originally posted by Folgad0 View Post
    Btw what do you mean with
    B) Change your #include to your .H file
    I dont understand
    Sorry, that may have been a bit unclear.

    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:


  • replied
    Fair enough. Did you get the code to compile without errors after my suggested fix?

    Leave a comment:


  • replied
    Btw what do you mean with
    B) Change your #include to your .H file
    I dont understand

    Leave a comment:


  • replied
    and also i know tuturial is misspelled, everything is tuturial for me (im not english easier )

    Leave a comment:


  • replied
    Yeah... 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
    Which means that it's including all of the minimal features/capabilites of the engine. Since you aren't including it, all of the engine capabilities you're trying to use are unknown to the compiler and you're getting the funky errors you're seeing.

    Leave a comment:


  • replied
    And also in the .H file i got this error Click image for larger version

Name:	erro2.png
Views:	1
Size:	111.6 KB
ID:	1062220

    Leave a comment:

Working...
X