# FString to FString \* ??

**URL:** <https://forums.unrealengine.com/t/fstring-to-fstring/424243>\
**Category:** Plugins\
**Tags:** fstring, unreal-engine, compile, Plugins, question\
**Created:** [May 3, 2018, 2:10pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243 "2018-05-03T14:10:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5f225f0d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5f225f0d](https://forums.unrealengine.com/u/anonymous_user_5f225f0d)\
**Post date:** [May 3, 2018, 2:10pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/1 "2018-05-03T14:10:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MrMcKvarz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrMcKvarz](https://forums.unrealengine.com/u/MrMcKvarz)\
**Post date:** [May 3, 2018, 2:13pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/2 "2018-05-03T14:13:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5f225f0d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5f225f0d](https://forums.unrealengine.com/u/anonymous_user_5f225f0d)\
**Post date:** [May 3, 2018, 2:27pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/3 "2018-05-03T14:27:07Z")

</div>

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);  
}

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5f225f0d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5f225f0d](https://forums.unrealengine.com/u/anonymous_user_5f225f0d)\
**Post date:** [May 3, 2018, 2:27pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/4 "2018-05-03T14:27:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MrMcKvarz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrMcKvarz](https://forums.unrealengine.com/u/MrMcKvarz)\
**Post date:** [May 3, 2018, 3:42pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/5 "2018-05-03T15:42:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5f225f0d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5f225f0d](https://forums.unrealengine.com/u/anonymous_user_5f225f0d)\
**Post date:** [May 3, 2018, 3:45pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/6 "2018-05-03T15:45:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5f225f0d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5f225f0d](https://forums.unrealengine.com/u/anonymous_user_5f225f0d)\
**Post date:** [May 3, 2018, 3:46pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/7 "2018-05-03T15:46:22Z")

</div>

here they say it’s abug:

> **[Create a new Level from C++ code](https://forums.unrealengine.com/questions/440347/create-a-new-level-from-c-code.html)**
>
> Greetings, Is it possible to create a new Level (so a new .umap file) directly from C++ code, for example from a plugin’s code ? I would like to automate the level creation (not having to go through the editor =\> new Level menu) then populate it...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5f225f0d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5f225f0d](https://forums.unrealengine.com/u/anonymous_user_5f225f0d)\
**Post date:** [May 3, 2018, 3:46pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/8 "2018-05-03T15:46:48Z")

</div>

but they made it work somehow 😕

---

<div class="post-metadata">

**Author:** ![MrMcKvarz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrMcKvarz](https://forums.unrealengine.com/u/MrMcKvarz)\
**Post date:** [May 3, 2018, 4:16pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/9 "2018-05-03T16:16:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5f225f0d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5f225f0d](https://forums.unrealengine.com/u/anonymous_user_5f225f0d)\
**Post date:** [May 3, 2018, 4:44pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/10 "2018-05-03T16:44:43Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8c2440f9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8c2440f9](https://forums.unrealengine.com/u/anonymous_user_8c2440f9)\
**Post date:** [January 22, 2019, 12:33pm UTC](https://forums.unrealengine.com/t/fstring-to-fstring/424243/11 "2019-01-22T12:33:41Z")

</div>

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