Clang Error LNK2019 From FPlatformTime::Seconds ( )

loh0123
Wed, 18 Feb 2026 13:07:35 +0000
Programming & Scripting

I try to switch to clang compiler on UE 5.7. It compile on first time but after add one line of FPlatformTime::Seconds ( ) it get compile error

I follow Use Clang to Build Microsoft Platforms in Unreal Engine | Unreal Engine 5.7 Documentation | Epic Developer Community and install clang by using visual studio installer.

Clang version is 19.1.5

This is my BuildConfiguration

<?xml version="1.0" encoding="utf-8" ?>

<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">

    <WindowsPlatform>

        <Compiler>Clang</Compiler>

        <bAllowClangLinker>False</bAllowClangLinker>

    </WindowsPlatform>

</Configuration>

Code that cause this error

void UTest_BPLibrary::TestBPLibrary ( )
{
    const double PTSecond = FPlatformTime::Seconds ( );
}

Can some one explain how can i fix this

Log

CONSOLE: Use build tool: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.exe
:   : null
8:57:13 PM Building D:\Unreal Engine\Project File\TestCoding\Intermediate\ProjectFiles\TestCoding.vcxproj
“D:\Epic Game\UE_5.7\Engine\Build\BatchFiles\Build.bat” TestCodingEditor Win64 Development -Project=“D:\Unreal Engine\Project File\TestCoding\TestCoding.uproject” -WaitMutex -FromMsBuild -architecture=x64
Using bundled DotNet SDK version: 8.0.412 win-x64
Running UnrealBuildTool: dotnet “....\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” TestCodingEditor Win64 Development -Project=“D:\Unreal Engine\Project File\TestCoding\TestCoding.uproject” -WaitMutex -FromMsBuild -architecture=x64
Log file: C:\Users\Loh0123\AppData\Local\UnrealBuildTool\Log.txt
Building TestCodingEditor…
Using Clang 19.1.5 compiler (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64) with Visual Studio 2022 14.44.35222 runtime (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Determining max actions to execute in parallel (8 physical cores, 16 logical cores)
Executing up to 8 processes, one per physical core
Using Unreal Build Accelerator local executor to run 4 action(s)
Storage capacity 40Gb
---- Starting trace: 260218_205714 ----
UbaSessionServer - Disable remote execution (remote sessions will finish current processes)
[1/4] Compile [x64] Test_BPLibrary.cpp
[2/4] Link [x64] UnrealEditor-TestCoding.lib
[3/4] Link [x64] UnrealEditor-TestCoding.dll
0>Test_BPLibrary.cpp.obj: Error LNK2019 : unresolved external symbol “__declspec(dllimport) int __cdecl Windows::QueryPerformanceCounter(union _LARGE_INTEGER *)” (_imp?QueryPerformanceCounter@Windows@@YAHPEAT_LARGE_INTEGER@@
) referenced in function “private: void __cdecl UTest_BPLibrary::TestBPLibrary(void)” (?TestBPLibrary@UTest_BPLibrary@@AEAAXXZ)
0>UnrealEditor-TestCoding.dll: Error LNK1120 : 1 unresolved externals
Trace written to file C:/Users/Loh0123/AppData/Local/UnrealBuildTool/Log.uba with size 4.0kb
Total time in Unreal Build Accelerator local executor: 5.32 seconds

Result: Failed (OtherCompilationError)
Total execution time: 5.92 seconds
0>Microsoft.MakeFile.Targets(44,5): Error MSB3073 : The command ““D:\Epic Game\UE_5.7\Engine\Build\BatchFiles\Build.bat” TestCodingEditor Win64 Development -Project=“D:\Unreal Engine\Project File\TestCoding\TestCoding.uproject” -WaitMutex -FromMsBuild -architecture=x64” exited with code 6.

1 post - 1 participant