Announcement

Collapse
No announcement yet.

Problems with my first c++ codes

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

    Problems with my first c++ codes

    Hi,

    I'm getting started with UE4 and UE4 programming.
    I have a basic to intermediate c++ experience background.
    I followed the videos on how to get the source code from github and set up UE4.
    I've also installed VisualStudio 2013 Express.

    Now I'm following these two projects:
    1- First Person Shooter C++ Tutorial:
    https://wiki.unrealengine.com/First_...2B%2B_Tutorial

    2- HelloWorldPrinter Tutorial:
    https://docs.unrealengine.com/latest...art/index.html


    I'm having the following problems (sorry if this is basic stuff but I'm just learning again after a long stop and now trying to catch up):

    1- In both projects, inside the editor, when I go to 'file' -> 'add code to project' -> 'Select Actor' -> give it a name -> click 'Create' -> click 'yes' on the dialog that appears.
    Problem: The project's solution does NOT open, and I can't edit the new class. I have to go to my projects folder and open the solution manually.

    2- Inside the header file in the project solution; #include "HelloWorldPrinter.generated.h" has a red underline and the error message reads: Error: cannot open source file HelloWorldPrinter.generated.h for both projects

    similar problem with GENERATED_UCLASS_BODY() (error:expected an identifier)
    and multiple similar types of errors in the source (.cpp) file

    3- When I build the project(s) I get the following error:
    "EXEC : error : Couldn't find target rules file for target 'BasicClassEditor' in rules assembly 'BasicClassEditorModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'."


    Any help is appreciated...
    Last edited by CGZee; 04-10-2014, 03:53 AM. Reason: uploading image

    #2
    Any idea guys?

    Comment


      #3
      I cant exactly answer your questions because a lot of things might be the answer.
      1-It may be something about permissions maybe Editor is not permitted to open Vs ?
      2 and 3 - It looks like there's a problem about your installation because the default projects should compile unless you didnt change anything.

      Comment


        #4
        Originally posted by arkenthera View Post
        I cant exactly answer your questions because a lot of things might be the answer.
        1-It may be something about permissions maybe Editor is not permitted to open Vs ?
        2 and 3 - It looks like there's a problem about your installation because the default projects should compile unless you didnt change anything.
        Thank you arkenthera for your response

        For (1): I'll look in the editor to see if there's anything about permissions and/or setting up VS as the default editor
        For (2): The only thing I did was during the process of creating the blank projects where I selected a different projects folder destination and had them save to my d: drive where the engine is located.

        Comment


          #5
          Originally posted by CGZee View Post
          For (1): I'll look in the editor to see if there's anything about permissions and/or setting up VS as the default editor
          Navigate to your visual studio folder and check its permissions at the security tab in the properties.It may be it.or UAC maybe?

          Comment


            #6
            Originally posted by arkenthera View Post
            Navigate to your visual studio folder and check its permissions at the security tab in the properties.It may be it.or UAC maybe?
            Didn't work. Still having the same issue. Nothing is compiling or working for me. I'm thinking removing all projects and UE4 and do a clean install.

            Comment


              #7
              This is so frustrating....I removed UE4 completely. Reinstalled and followed documentation and video tutorial step by step and still can't edit the class code after adding it in the editor and when I manually open the solution I find it unable to identify all required headers and files like (className.generated.h) and macros (UCLASS, GENERATED_UCLASS_BODY)...etc

              Comment


                #8
                Do these errors actually happen when you try and build the projects? Sometimes the intellisense is just stupid and doesn't pick up certain things until you try and build. Also, are you using any other VS environments on your computer?

                Comment


                  #9
                  Pretty sure the Express version of VS cannot be opened by external applications, you need Professional or Ultimate.
                  The generated.h files dont exist in the beginning. They will get generated by the macros during the compilation, just ignore the error and build the project, it should work just fine.

                  Comment


                    #10
                    Originally posted by Benjiko99 View Post
                    Pretty sure the Express version of VS cannot be opened by external applications
                    It can be.

                    Comment


                      #11
                      Thank you guys

                      Originally posted by Dune View Post
                      Do these errors actually happen when you try and build the projects? Sometimes the intellisense is just stupid and doesn't pick up certain things until you try and build. Also, are you using any other VS environments on your computer?
                      They happen as soon as I open the solution and the header file. For projects that were saved in the default "c:\documents\unreal projects\", building and rebuilding couple of times actually helped and errors disappeared. But for projects that were saved in "D:\GitHub\UnrealEngine\Unreal Projects" when they were created, building and rebuilding never solved the problem and errors still exist. I can't just keep creating projects in my c: drive. it's almost full now. BTW, all UE4 engine files are in my d: drive. The only thing that was automatically created in c: was the unreal projects folder.

                      Originally posted by Benjiko99 View Post
                      Pretty sure the Express version of VS cannot be opened by external applications, you need Professional or Ultimate.
                      The generated.h files dont exist in the beginning. They will get generated by the macros during the compilation, just ignore the error and build the project, it should work just fine.
                      Thanks for the VS Express info.! That's probably why it's not opening.
                      As mentioned above, building projects that are not in the default 'c:\documents\unreal projects' folder never works.

                      Comment


                        #12
                        Originally posted by CGZee View Post
                        2- Inside the header file in the project solution; #include "HelloWorldPrinter.generated.h" has a red underline and the error message reads: Error: cannot open source file HelloWorldPrinter.generated.h for both projects

                        similar problem with GENERATED_UCLASS_BODY() (error:expected an identifier)
                        and multiple similar types of errors in the source (.cpp) file
                        I was horribly confused by this at first, hah.
                        This always happens when you add a new class with the menu, you need to close the editor and rebuild the solution so it creates the generated header file.

                        Originally posted by Benjiko99 View Post
                        Pretty sure the Express version of VS cannot be opened by external applications, you need Professional or Ultimate.
                        It opens express for me just fine.

                        Comment


                          #13
                          Thank you Zeblote

                          Originally posted by Zeblote View Post
                          I was horribly confused by this at first, hah.
                          This always happens when you add a new class with the menu, you need to close the editor and rebuild the solution so it creates the generated header file.
                          Does that work for projects created outside the default "c:\documents\unreal projects" folder? I point my newly created projects to point to my d: drive and it never compiles and the errors remain no matter how many times I rebuild.

                          Originally posted by Zeblote View Post
                          It opens express for me just fine.
                          Any setting change I need to make to my UE4 editor? I installed three time and still doesn't open.

                          Comment


                            #14
                            Originally posted by CGZee View Post
                            Does that work for projects created outside the default "c:\documents\unreal projects" folder? I point my newly created projects to point to my d: drive and it never compiles and the errors remain no matter how many times I rebuild.
                            Well it does for me, considering my projects are located in D:\Unreal Projects as my C: drive would get full too fast.

                            Worth noting that intellisense takes forever to parse the project and that it shows errors until it finished doing that.

                            Comment


                              #15
                              When I go to "file->project->open visual studio" I get the following message:

                              "Could not open Visual Studio 2013 for project D:/GitHub/Unreal Projects/test/test.sln"

                              Comment

                              Working...
                              X