2012-03-28 64 views
1

希望有人能夠與這一個幫助,我」,使用Win32 Python 2.7版,VC9 Win64上,遵循的步驟here,但現在我得到這樣的錯誤:的mysql-Python構建LNK錯誤

running build 
running build_py 
copying MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb 
running build_ext 
building '_mysql' extension 
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox 
/MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 "-IC: 
\Program Files\MySQL\Connector C 6.0.2\include" -IC:\Python27\include -IC:\Pytho 
n27\PC /Tc_mysql.c /Fobuild\temp.win32-2.7\Release\_mysql.obj /Zl 
_mysql.c 
C:\Program Files\MySQL\Connector C 6.0.2\include\config-win.h(24) : warning C400 
5: '_WIN32_WINNT' : macro redefinition 
     C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sdkddkver.h(
197) : see previous definition of '_WIN32_WINNT' 
C:\Program Files\MySQL\Connector C 6.0.2\include\config-win.h(203) : warning C40 
05: 'SIZEOF_OFF_T' : macro redefinition 
     c:\python27\include\pyconfig.h(355) : see previous definition of 'SIZEOF 
_OFF_T' 
C:\Program Files\MySQL\Connector C 6.0.2\include\config-win.h(301) : warning C40 
05: 'HAVE_STDDEF_H' : macro redefinition 
     c:\python27\include\pyconfig.h(673) : see previous definition of 'HAVE_S 
TDDEF_H' 
_mysql.c(1364) : warning C4018: '<' : signed/unsigned mismatch 
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo 
/INCREMENTAL:NO "/LIBPATH:C:\Program Files\MySQL\Connector C 6.0.2\lib\opt" /LIB 
PATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild kernel32.lib advapi32.lib wso 
ck32.lib mysqlclient.lib /EXPORT:init_mysql build\temp.win32-2.7\Release\_mysql. 
obj /OUT:build\lib.win32-2.7\_mysql.pyd /IMPLIB:build\temp.win32-2.7\Release\_my 
sql.lib /MANIFESTFILE:build\temp.win32-2.7\Release\_mysql.pyd.manifest 
    Creating library build\temp.win32-2.7\Release\_mysql.lib and object build\tem 
p.win32-2.7\Release\_mysql.exp 

這是錯誤部分:

_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_Exception 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_Exception 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] ref 
erenced in function __mysql_server_init 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refer 
enced in function __mysql_server_end 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refe 
renced in function __mysql_thread_safe 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] ref 
erenced in function __mysql_ResultObject_Initialize 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refer 
enced in function __mysql_ResultObject_Initialize 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] ref 
erenced in function __mysql_ResultObject_Initialize 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refer 
enced in function __mysql_ResultObject_Initialize 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] re 
ferenced in function __mysql_ConnectionObject_Initialize 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referen 
ced in function __mysql_ConnectionObject_Initialize 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referen 
ced in function __mysql_ConnectionObject_Initialize 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_ConnectionObject_Initialize 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_ConnectionObject_close 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] re 
ferenced in function __mysql_ConnectionObject_affected_rows 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_debug 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] 
referenced in function __mysql_ConnectionObject_dump_debug_info 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refer 
enced in function __mysql_ConnectionObject_autocommit 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] reference 
d in function __mysql_ConnectionObject_commit 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referen 
ced in function __mysql_ConnectionObject_rollback 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refe 
renced in function __mysql_ConnectionObject_next_result 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] 
8 referenced in function __mysql_ConnectionObject_set_server_option 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referen 
ced in function __mysql_ConnectionObject_sqlstate 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] re 
ferenced in function __mysql_ConnectionObject_warning_count 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] r 
eferenced in function __mysql_escape_string 
_mysql.obj : error LNK2019: unresolved external symbol _mysql_real_escape_string 
@16 referenced in function __mysql_escape_string 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] re 
ferenced in function __mysql_row_to_tuple 
_mysql.obj : error LNK2019: unresolved external symbol __imp__strncpy referenced 
in function __mysql_row_to_dict 
_mysql.obj : error LNK2019: unresolved external symbol __imp__strncat referenced 
in function __mysql_row_to_dict 
_mysql.obj : error LNK2019: unresolved external symbol _memset referenced in fun 
ction __mysql_row_to_dict_old 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refere 
nced in function __mysql__fetch_row 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referen 
ced in function __mysql_ResultObject_fetch_row 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] ref 
erenced in function __mysql_ConnectionObject_change_user 
_mysql.obj : error LNK2019: unresolved external symbol _mysql_character_set_name 
@4 referenced in function __mysql_ConnectionObject_character_set_name 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] 
8 referenced in function __mysql_ConnectionObject_set_character_set 
_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_character_set_ 
[email protected] referenced in function __mysql_ConnectionObject_get_character_set_info 
_mysql.obj : error LNK2019: unresolved external symbol _mysql_get[email protected] 
referenced in function __mysql_get_client_info 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] re 
ferenced in function __mysql_ConnectionObject_get_host_info 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] r 
eferenced in function __mysql_ConnectionObject_get_proto_info 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] 
referenced in function __mysql_ConnectionObject_get_server_info 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_ConnectionObject_info 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refere 
nced in function __mysql_ConnectionObject_insert_id 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_ConnectionObject_kill 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refe 
renced in function __mysql_ConnectionObject_field_count 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_ConnectionObject_ping 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refe 
renced in function __mysql_ConnectionObject_query 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refere 
nced in function __mysql_ConnectionObject_select_db 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referen 
ced in function __mysql_ConnectionObject_shutdown 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced 
in function __mysql_ConnectionObject_stat 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refere 
nced in function __mysql_ConnectionObject_thread_id 
_mysql.obj : error LNK2019: unresolved external symbol __imp__sprintf referenced 
in function __mysql_ConnectionObject_repr 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refer 
enced in function __mysql_ResultObject_data_seek 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referen 
ced in function __mysql_ResultObject_row_seek 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referen 
ced in function __mysql_ResultObject_row_seek 
_mysql.obj : error LNK2019: unresolved external symbol [email protected] refe 
renced in function __mysql_ResultObject_dealloc 
LINK : error LNK2001: unresolved external symbol [email protected] 
build\lib.win32-2.7\_mysql.pyd : fatal error LNK1120: 56 unresolved externals 
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link. 
exe"' failed with exit status 1120 

在此先感謝您的任何幫助或提示。

回答

0

爲了解決鏈接錯誤,如 「無法解析的外部符號__DllMainCRTStartup @ 12」 上的Visual Studio 2012 Express附加鏈接庫: MSVCRT.LIB,MSVCRTD.LIB