Skip to content

LNK2019 unresolved external symbol in Unreal Engine project after upgrading llama.cpp #16078

@NatakuZ

Description

@NatakuZ

Git commit

https://github.com/ggml-org/llama.cpp/releases/tag/b6496

Operating systems

Windows

GGML backends

CUDA

Problem description & steps to reproduce

Hi ,

I'm currently using llama.cpp (commit b5215) successfully within my Unreal Engine project by linking against the compiled .dll and .lib files.

I'm trying to upgrade to one of the latest versions of llama.cpp to get support for newer models like embeddinggemma-300m-Q4_0.

what i do :
Cloned the latest master branch (at moment was b6496 )of llama.cpp.

Built the library from source on Windows using the following CMake commands:

Bash

cmake -B build -DGGML_CUDA=ON -DLLAMA_CURL=OFF -DGGML_CCACHE=OF
cmake --build build --config Release
Replaced the old .dll, .lib, and header files in my Unreal Engine project with the newly generated ones.

Tried to compile my Unreal Engine project.

Current Behavior
The Unreal Engine project fails to link, showing the following error:

common.lib(common.obj) : error LNK2019: unresolved external symbol __std_search_1 referenced in function "char const * __cdecl std::_Search_vectorized<char const ,char const >(char const * const,char const * const,char const * const,unsigned __int64)" (??$_Search_vectorized@$$CBD$$CBD@std@@YAPEBDQEBD00_K@Z)
My Hypothesis
I suspect this might be caused by a mismatch between the C++ standard or the MSVC toolset version used to compile the new llama.cpp library and the one my Unreal Engine project is configured to use. Unreal Engine typically uses C++17, and it's possible that recent versions of llama.cpp default to C++20 or use a newer Visual Studio toolset, causing this standard library symbol (__std_search_1) to be unresolved.

Could you please confirm if there have been recent changes to the required C++ standard or provide guidance on which build flags I should use to ensure compatibility with an environment that expects C++17?

System Information
OS: Windows 10

Unreal Engine Version: 5.6

Visual Studio Version: 2022 17.14.15

llama.cpp last working commit: b5215

llama.cpp new failing commit: b6496

Thank you for your help!

First Bad Commit

No response

Compile command

cmake -B build -DGGML_CUDA=ON -DLLAMA_CURL=OFF -DGGML_CCACHE=OF
cmake --build build --config Release

Relevant log output

>common.lib(common.obj) : error LNK2019: unresolved external symbol __std_search_1 referenced in function "char const * __cdecl std::_Search_vectorized<char const ,char const >(char const * const,char const * const,char const * const,unsigned __int64)" (??$_Search_vectorized@$$CBD$$CBD@std@@YAPEBDQEBD00_K@Z)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions