ue4-intellisense-fixes icon indicating copy to clipboard operation
ue4-intellisense-fixes copied to clipboard

UE5 Ubuntu - Cannot open source file

Open JoshEthan opened this issue 2 years ago • 9 comments

@boocs I was able to for sure generate the uproject file, but still no luck.

JoshEthan avatar May 03 '22 23:05 JoshEthan

I'm downloading the full source now on Windows(I used to have Ubuntu full source...).

  • What's your project name (ClassCreation?)?
  • What's the class name and type that you added?

If you don't want to say, just say the class type that you added. I want to recreate what you have.

Also that link was showing how to Generate Visual Studio Project Files for UE5. It's a soft reset for your project and will add all your current project source files to your compile commands file.

boocs avatar May 04 '22 00:05 boocs

I can confirm this. When compiling my, full source, project the *.generated.h files aren't being created.

I'll have to mess with this more tomorrow.

boocs avatar May 04 '22 09:05 boocs

@JoshEthan

I was able to fix mine. I had to do a full rebuild of my project. Make sure it's your project and not the Full Source UE5 like I did... Luckily I didn't need the editor to fix my project.

To rebuild, I used MyProjectNameEditor Win64 Developement. Once the 5 hours were done I had my *.generated.h files. After, hopefully you don't have to do a full rebuild of the project, after adding another class, and just a normal build will do.

Now you have to Generate Project Files so the *.generated.h path is added to your rsp files that the compile command files use. I didn't have to use the command line on Windows but I'm not sure if this will work on Linux. In VSCode there is a Run and Debug icon on the left. If you scroll through the long list of options there's Generate Project Files option. Once I ran that, I had to wait for Intellisense to update and finally no errors.

To run Generate Project Files from VSCode you need the Microsoft C# extension. If you can't get it to work go to the Run and Debug and choose Generate Project Files but don't run it. Click the sprocket to the right of the name and it'll open launch.json and take you to the entry for Generate Project Files. At least you'll know the command line and flags that it uses so you can try it manually.

boocs avatar May 04 '22 17:05 boocs

I rebuilt it, generated the files, and I still have the error. I think I will just call it good here lol. Seems to be destiny.

JoshEthan avatar May 05 '22 20:05 JoshEthan

You can manually check the *.rsp file to see if it added the correct path. It's basicially a file of compiler flags that will be used with Intellisense. Most project files will use the YourProjectName.#.rsp format. For example my project, named CoopGame, uses CoopGame.182.rsp for the Intellisense compiler flags. The number will probably differ for your *.rsp files.

Maybe I can add that to a fix where it will detect if you have no *.generated files and if you do that it's added to the *.rsp file automatically if not there.

boocs avatar May 06 '22 03:05 boocs

The rsp file did not have any generated files, CoreMinimal, or even GameModeBase in it. Seems like it's just missing a bunch of paths. If I understood that correctly.

JoshEthan avatar May 06 '22 14:05 JoshEthan

Yeah it will only have the paths to those files, which it will. The bug is that it doesn't have the path to your *.generated.h files. It will usually be only one path.

Maybe it needs to be a specific Build for it to work.

When you click Terminal->Run Build Task... Which option do you choose?

I've been using YouProjectNameEditor (notice the Editor suffix) and "Win64 Development Build" (or Rebuild if the *.generated.h files don't get created)

Remember to do the Generate Project Files after.

boocs avatar May 06 '22 19:05 boocs

I run the YourProjectEditor Linux Development Rebuild. I don't have a Win64 option. I've also ran "YourProject Linux Development Build" and "YourProject LinuxArm64 Development Build"

JoshEthan avatar May 06 '22 19:05 JoshEthan

When I do it with the Editor Suffix and Win64 the *.generated.h files get created in: Intermediate\Build\Win64\UnrealEditor\Inc\MyProjectName directory.

Yours should be similiar.

Now if I look into my rsp files I have this: /I "K:\ME\Documents\Unreal Projects\UE5_RelTest\Intermediate\Build\Win64\UnrealEditor\Inc\UE5_RelTest"

Win64 will be different for you. UnrealEditor is because of the Editor suffix when building. I think it will be UnrealGame if you don't use the suffix.

Try it with the Editor Suffix and Linux. Then Generate Project Files and see if it adds it to YourProjectName.#.rsp. It won't add it to most of the *.rsp files so make sure it's the specific one.

boocs avatar May 06 '22 20:05 boocs