我尝试使用这些设置构建php:
configure --disable-all --enable-cli --enable-cgi --with-mysql --enable-pdo --with-pdo-mysql=shared
并且如果我尝试使用--with-pdo-mysql
进行编译,则总是返回该错误 Creating library Release_TS\php_pdo_mysql.lib and object Release_TS\php_pdo_mysql.exp
mysql_driver.obj : error LNK2019: unresolved external symbol __imp___mysqlnd_init referenced in function _mysql_handle_autocommit
mysql_driver.obj : error LNK2019: unresolved external symbol __imp__mysqlnd_connect referenced in function _mysql_handle_autocommit
mysql_driver.obj : error LNK2019: unresolved external symbol __imp__mysqlnd_get_client_info referenced in function _mysql_handle_autocommit
pdo_mysql.obj : error LNK2001: unresolved external symbol __imp__mysqlnd_get_client_info
mysql_statement.obj : error LNK2019: unresolved external symbol __imp___mysqlnd_fetch_lengths referenced in function _pdo_mysql_stmt_execute_prepared_mysqlnd
mysql_statement.obj : error LNK2019: unresolved external symbol __imp__mysqlnd_allocator referenced in function _PDO_DBG_ENTER
pdo_mysql.obj : error LNK2019: unresolved external symbol __imp__mysqlnd_reverse_api_register_api referenced in function _get_module
Release_TS\php_pdo_mysql.dll : fatal error LNK1120: 6 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.exe"' : return code '0x2'
Stop.
如果我尝试没有--with-pdo-mysql我可以编译没有错误。 我使用Visual Studio 2013
编辑:只需添加
即可解决--with-extra-libs=deps\lib --with-extra-includes=deps\include