我可以用 C++ 开发 PDO 扩展吗?

Der*_*Lee 5 php pdo php-extension

我可以用 c++ 而不是 c 编写 PDO 扩展吗?(Windows10,PHP7.2)

这是 pdo ext 应该涵盖的内容(根据官方文档):

config.m4                  # unix build script
  config.w32                 # win32 build script
  CREDITS
  package.xml                # meta information about the package
  pdo_SKEL.c                 # standard PHP extension glue
  php_pdo_SKEL.h
  php_pdo_SKEL_int.h         # driver private header
  SKEL_dbh.c                 # contains the implementation of the PDO driver interface
  SKEL_stmt.c                # contains the implementation of the PDO statement interface
  tests/
Run Code Online (Sandbox Code Playgroud)

我可以重命名pdo_SKEL.cpdo_SKEL.cpp,并将 config.w32 中的 c 文件名更改为 cpp 吗?

我尝试了一些简单的代码和功能,它有效。但是每次当我想将 ext 注册到 pdo 时,编译都不会通过。

Error   LNK2019 unresolved external symbol "int __cdecl php_pdo_register_driver(struct pdo_driver_t *)" (?php_pdo_register_driver@@YAHPEAUpdo_driver_t@@@Z) referenced in function "int __cdecl zm_startup_pdo_my_mysql(int,int)" (?zm_startup_pdo_my_mysql@@YAHHH@Z)   pdo_module  C:\php\pdo_module.obj   1   

Run Code Online (Sandbox Code Playgroud)