FPlatformApplicationMisc::ClipboardCopy() fails to link

I’ve been taking care of all the deprecated warnings in my 4.18 code and changed “FGenericPlatformMisc::ClipboardCopy()” to “FPlatformApplicationMisc::ClipboardCopy()” as demanded by the compiler. It compiles fine, but refuses to link now. The error msg is:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl FWindowsPlatformApplicationMisc::ClipboardCopy(wchar_t const *)

As I understand it, this should be part of the core module which is included in the build. What’s going on here?

1 Like

Looking at the source, it appears that the extra module you need is “ApplicationCore” (see GenericPlatformApplicationMisc.h)

5 Likes

That fixed it. Thanks.

When i use


FGenericPlatformApplicationMisc::ClipboardCopy(*MyString);

i can´t paste the string in another Texteditor with “STRG+V”. I guess i can only paste it inside Unreal with


FGenericPlatformApplicationMisc::ClipboardPaste()

. But i need the more globay way. Does somebody know how to manage this ? Thanks.

Hello,
i ran into the seame problem, but What do I need to do, to get this compiling?

A bit late but I was looking into this today:

In the file where you call FPlatformApplicationMisc::ClipboardPaste, you need to include #include "HAL/PlatformApplicationMisc.h".

Then in your Build.cs, you will need to add "ApplicationCore"

4 Likes

Sad that I’ve been testing the " FGenericPlatformApplicationMisc::ClipboardCopy(*Str)", it didn’t work on PC, check this topic twice, I finally realize that correct function is “FPlatformApplicationMisc::ClipboardPaste(*Str)” :sweat_smile:

cheers!

1 Like

thank you, bro you are amazing,
you are my here lol

link error is the missing module. clipboard lives in ApplicationCore, not Core, so add ApplicationCore to PublicDependencyModuleNames in your Build.cs and include HAL/PlatformApplicationMisc.h where you call it. then FPlatformApplicationMisc::ClipboardCopy works.

and for the followup in this thread, copy is OS-wide, not unreal-only. once the call succeeds you can paste into any text editor with ctrl+v, the earlier confusion was just the wrong function name (paste vs copy).

if you want the same thing without c++, runtime clipboard utility from fab wraps copy and paste as blueprint nodes, handy when designers need it.