Can I add the dlopen path of UnrealEditor?

I downloaded Unreal Engine 5.1.0 from Linux - Unreal Engine and used it.

The engine directory is /home/user/Linux_Unreal_Engine_5.1.0 and the project directory is /home/user/dev/MyProject. I’m also using my own library to implement the server and the .so file is routed to /home/user/dev/bin/release.x64/libMyLib.so . To use this, I added the following to build.cs

PublicAdditionalLibraries.Add(MyLibPath);
RuntimeDependencies.Add(MyLibPath);
PublicDelayLoadDLLs.Add(MyLibPath);

I also added a directory with .so files to LD_LIBRARY_PATH via ~/.bashrc.

This worked normally when run through vscode. However, the module could not be built when UnrealEditor was directly run and then the .uproject file was selected to run. The logs are as follows.

LogCore: Warning: dlopen failed: libMyLib.so: cannot open shared object file: No such file or directory

I think LD_LIBRARY_PATH is exported when running through vscode, so the engine can use the library, but when running UnrealEditor directly, it doesn’t seem to be able to.

In fact, the error did not occur when I copied the .so file to /usr/lib.

Other issues are likely to arise if I copy all libraries to /usr/lib. Can’t I get UnrealEngine to use the library in my custom path?