Skip to content

Windows + vcpkg: unresolved external symbol dpp::bignumber::bn_deleter::operator() when linking minimal example #1527

@k03440k

Description

@k03440k

Describe the bug

When building a minimal DPP project on Windows using vcpkg, CMake, and Visual Studio 2022, the linker fails with an unresolved external symbol related to dpp::bignumber::bn_deleter::operator().

This happens even with a trivial example that only constructs a dpp::cluster. Reinstalling DPP and its dependencies does not resolve the issue.

To Reproduce

  1. Install vcpkg and integrate it with CMake / Visual Studio.

  2. Install DPP via vcpkg:

    vcpkg install dpp:x64-windows
  3. Create the following minimal project.

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)
project(DPPTest)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(dpp CONFIG REQUIRED)

add_executable(dpp_test main.cpp)
target_link_libraries(dpp_test PRIVATE dpp::dpp)

main.cpp

#include <dpp/dpp.h>

int main()
{
    dpp::cluster bot("YOUR_TOKEN_HERE");
    return 0;
}
  1. Configure and build the project with CMake / Visual Studio 2022.
  2. Observe the linker error.

Build error

unresolved external symbol
"public: void __cdecl dpp::bignumber::bn_deleter::operator()(
    struct dpp::openssl_bignum *
) const"
(??Rbn_deleter@bignumber@dpp@@QEBAXPEAUopenssl_bignum@2@@Z)

referenced in function
"public: __cdecl std::unique_ptr<
    struct dpp::openssl_bignum,
    struct dpp::bignumber::bn_deleter
>::~unique_ptr(void)"

However, if I put the next files into the folder with CMakeLists.txt and main.cpp, it successfully builds with dpp 10.1.3:

vcpkg.json

{
  "name": "test-dpp",
  "version-string": "0.1.0",
  "dependencies": [
    {
      "name": "dpp",
      "version>=": "10.1.3"
    }
  ]
}

vcpkg-configuration.json

{
  "default-registry": {
    "kind": "git",
    "repository": "https://github.com/microsoft/vcpkg",
    "baseline": "1dfb48f422cb9d17eb0ac5eea087fd3b66a2ba4d"
  }
}

System Details

  • OS: Windows 10 (x64)
  • Compiler / IDE: Visual Studio 2022 (17.14.23)
  • Build system: CMake
  • Package manager: vcpkg
  • DPP version: 10.1.4 (vcpkg)

Installed vcpkg packages(./vcpkg list)

dpp:x64-windows                                   10.1.4              D++ Extremely Lightweight C++ Discord Library.
nlohmann-json:x64-windows                         3.12.0#1            JSON for Modern C++
openssl:x64-windows                               3.6.0#3             OpenSSL is an open source project that provides ...
opus:x64-windows                                  1.5.2#1             Totally open, royalty-free, highly versatile aud...
vcpkg-cmake-config:x64-windows                    2024-05-23
vcpkg-cmake-get-vars:x64-windows                  2025-05-29
vcpkg-cmake:x64-windows                           2024-04-23
zlib:x64-windows                                  1.3.1               A compression library

Additional notes

  • The error occurs on a clean build.
  • Reinstalling DPP and all its dependencies did not help.
  • Clearing the build directory and reconfiguring from scratch did not help either.

Any guidance on whether this is a known issue or a missing linkage/configuration step would be greatly appreciated.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions