Skip to content

The Mysql is not supported by drogon, please install the development library first. #1146

@kotori2

Description

@kotori2

Describe the bug
When building project with vcpkg.json, mysql will not be enabled.
It seems libmariadb was built, but the macros in DbClientManager may not be properly set.

To Reproduce
Create an empty project with the following files:
vcpkg.json

{
  "name": "test",
  "version-string": "0.1",
  "port-version": 1,
  "homepage": "https://github.com/kotori2/test",
  "description": "Test",
  "dependencies": [
    {
      "name": "drogon",
      "features": [ "ctl", "mysql", "sqlite3" ]
    }
  ]
}

main.cpp

#include <drogon/drogon.h>

int main() {
    drogon::app().createDbClient("mysql", "127.0.0.1", 3306, "test", "root",
                                 "root", 4, "", "mysql", false, "utf8");
    return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.21)
project(test)

set(CMAKE_CXX_STANDARD 20)
find_package(Drogon CONFIG REQUIRED)

add_executable(test main.cpp)
target_link_libraries(test Drogon::Drogon)

Expected behavior

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
NA

Smartphone (please complete the following information):
NA

Additional context
vcpkg: e2a23177553d67ba633288876746b5a41b94a628
Drogon: v1.7.4 release

Metadata

Metadata

Assignees

No one assigned

    Labels

    FAQFrequently Asked Questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions