0
\$\begingroup\$

I am trying to create a file structure for my code in c++classes/Myproject (in UE4 editor). I added a new class and in UE4s "Add C++ Class" dialog box I set the path for the created scripts as MyProject/Source/MyProject/test, test being the subfolder I am trying to create, however when the editor finishes generating the files I get an error saying that it failed to find the files it generated.

...\MyProject\test\SysGen.cpp(4): fatal error C1083: Cannot open include file: 'test/SysGen.h': No such file or directory

In visual studio I can see and open the generated scripts, but it fails to compile. What do I need to do for this to work?

here are the files image taken from visual studio: enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Can you post a screenshot of the directory structure in Visual Studio? This will give us a visual clue as to what the problem is. \$\endgroup\$
    – Stephen
    Apr 26, 2021 at 8:34
  • \$\begingroup\$ @Stephen ok, I added an image. \$\endgroup\$
    – user169808
    Apr 26, 2021 at 19:10

1 Answer 1

1
\$\begingroup\$

From your picture, it seems that the cpp file is trying to look inside a subfolder called test for the header file where there isn't one.

In your #include, remove the test/ and it should clear this up.

\$\endgroup\$
2
  • \$\begingroup\$ thanks, now it compiles. Only problem is that ue4's UI doesnt show the subfolder \$\endgroup\$
    – user169808
    May 2, 2021 at 4:01
  • \$\begingroup\$ To get it to show up again, close Visual studio and the editor. Go into File Explorer and navigate to your game folder. Delete Binaries, Intermediate and the sln file then right click on your UProject file and choose "Generate Visual Studio Files" \$\endgroup\$
    – Stephen
    May 3, 2021 at 9:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .