FString to FString * ??

Hello I am trying to compile a Plugin For Editor Use, but I get this issue all the time:

error C2664: ‘bool FEditorFileUtils::SaveLevelAs(ULevel *,FString *)’: cannot convert argument 2 from ‘FString’ to ‘FString *’

best Regards

Hi, try bool FEditorFileUtils::SaveLevelAs(ULevel ,&FString )

thanks for Your Answerm, I am still not there, Not sure what I am doing wrong…

Header:

UFUNCTION(BlueprintCallable, meta = (DisplayName = “Create Empty World Level”, Keywords = “Word Stream Level”), Category = " Functions")
static void createLevelR(FString &FileName, FName WorldName);

CPP:

void UInsaneFunctionLib::createLevelR(FString &FileName, FName WorldName)
{
UWorld* myWorld = UWorld::CreateWorld(EWorldType::Editor, false, WorldName, nullptr, true);
bool temp = FEditorFileUtils::SaveLevelAs( myWorld->PersistentLevel , &FileName);
}

Error:

void UInsaneFunctionLib::createLevelR(FString &FileName, FName WorldName)
{
UWorld* myWorld = UWorld::CreateWorld(EWorldType::Editor, false, WorldName, nullptr, true);
bool temp = FEditorFileUtils::SaveLevelAs( myWorld->PersistentLevel , &FileName);
}

Now Error:
Creating library c:\a_BatchFolder\return\HostProject\Plugins\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-.suppressed.lib and object c:\a_BatchFolder\return\HostProject\Plugins\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-.suppressed.exp
Module…cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) public: static bool __cdecl FEditorFileUtils::SaveLevelAs(class ULevel *,class FString *)” (_imp?SaveLevelAs@FEditorFileUtils@@SA_NPEAVULevel@@PEAVFString@@@Z) referenced in function “private: static void __cdecl UInsaneFunctionLib::createLevelR(class FString &,class FName)” (?createLevelR@UInsaneFunctionLib@@CAXAEAVFString@@VFName@@@Z)
c:\a_BatchFolder\return\HostProject\Plugins\Binaries\Win64\UE4Editor-.dll : fatal error LNK1120: 1 unresolved externals
Creating library c:\a_BatchFolder\return\HostProject\Plugins\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-.lib and object c:\a_BatchFolder\return\HostProject\Plugins\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-.exp
ERROR: UBT ERROR: Failed to produce item: c:\a_BatchFolder\return\HostProject\Plugins\Binaries\Win64\UE4Editor-.dll
Total build time: 32,42 seconds (Local executor: 0,00 seconds)
Took 32,7072267s to run UnrealBuildTool.exe, ExitCode=5

It seems compiler doesn’t know where is SaveLeveAs function implementation, try including FileHelpers.h.

I did, I also tried to add to plugin Module. but than it says that such header does not exist…

here they say it’s abug:

but they made it work somehow :confused:

As that post says try copying SaveLevelAs code into your function or call it without a filename.

So I tried to include this : #include “Editor/UnrealEd/Public/FileHelpers.h” and #include “FileHelpers.h” in the cpp file.

I also tried without “FileName” but it’s all the time the same Error “LNK2018”

Error:
error LNK2019: unresolved external symbol “__declspec(dllimport) public: static bool __cdecl FEditorFileUtils::SaveLevelAs(class ULevel *,class FString *)” (_imp?SaveLevelAs@FEditorFileUtils@@SA_NPEAVULevel@@PEAVFString@@@Z) referenced in function “private: static void __cdecl UInsaneFunctionLib::createLevelR(class FString &,class FName)” (?createLevelR@UInsaneFunctionLib@@CAXAEAVFString@@VFName@@@Z)
c:\a_BatchFolder\return\HostProject\Plugins\Binaries\Win64\UE4Editor-.dll : fatal error LNK1120: 1 unresolved externals
ERROR: UBT ERROR: Failed to produce item: c:\a_BatchFolder\return\HostProject\Plugins\Binaries\Win64\UE4Editor-.dll
Total build time: 27,20 seconds (Local executor: 0,00 seconds)

lemme be your massiah for a sec… (jk) took me a long ■■■ time to find. add “UnrealEd” to publicDependencyMoudleNames in your build.cs