我一直收到这条消息。我也在使用Windows,因此在使命令正确时遇到一些麻烦。
对mysql_get_client_info'
的未定义引用从我可以弄清楚当我谷歌它我没有正确链接。所以我尝试了这个。
gcc *.c -L"C:\Program Files\MySQL\MySQL Server 5.7\lib"
我可以帮忙解决一下我做错了什么吗?
那不起作用。我做错了吗?
$ gcc *.c -L"C:\Program Files\MySQL\MySQL Server 5.7\lib" -lmysqlclient
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.text$x+0x23): undefined reference to `??2@YAPEAX_K@Z'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.text$x+0x23): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `??2@YAPEAX_K@Z'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.text$x+0x2e): undefined reference to `__imp_?_Xbad_alloc@std@@YAXXZ'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.text$x+0x2e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_?_Xbad_alloc@std@@YAXXZ'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.text$x+0x61): undefined reference to `??3@YAXPEAX@Z'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.text$x+0x61): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `??3@YAXPEAX@Z'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.text$x+0x7d): undefined reference to `_CxxThrowException'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.text$x+0x7d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_CxxThrowException'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.xdata[$unwind$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K0@Z]+0x10): undefined reference to `__CxxFrameHandler3'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.xdata[$unwind$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K0@Z]+0x10): relocation truncated to fit: rva32 against undefined symbol `__CxxFrameHandler3'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.xdata[$unwind$?catch$1@?0??_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K0@Z@4HA]+0x8): undefined reference to `__CxxFrameHandler3'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.xdata[$unwind$?catch$1@?0??_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K0@Z@4HA]+0x8): relocation truncated to fit: rva32 against undefined symbol `__CxxFrameHandler3'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.xdata[$unwind$?catch$0@?0??_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K0@Z@4HA]+0xc): undefined reference to `__CxxFrameHandler3'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.xdata[$unwind$?catch$0@?0??_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K0@Z@4HA]+0xc): relocation truncated to fit: rva32 against undefined symbol `__CxxFrameHandler3'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.rdata[??_7error_category@std@@6B@]+0x10): undefined reference to `_purecall'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.rdata[??_7error_category@std@@6B@]+0x18): undefined reference to `_purecall'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/client_authentication.obj):(.data$r+0x0): undefined reference to `??_7type_info@@6B@'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x15): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x15): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xed): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xed): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xd): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xd): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x99): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x99): additional relocation overflows omitted from the output
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xb): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x163): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xd): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x14a): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x17): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x257): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xa): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x2f7): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xb): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x1b7): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x11): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x2fb): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x10): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x72): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x10): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x17c): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x10): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x72): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x9): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x3f): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xf3): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xd): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x248): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xd): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xb7): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xd): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0x121): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xd): undefined reference to `__security_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.text$mn+0xa8): undefined reference to `__security_check_cookie'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.xdata[$unwind$mysql_list_dbs]+0x10): undefined reference to `__GSHandlerCheck'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.xdata[$unwind$mysql_list_tables]+0x10): undefined reference to `__GSHandlerCheck'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.xdata[$unwind$mysql_list_fields]+0x10): undefined reference to `__GSHandlerCheck'
C:\Program Files\MySQL\MySQL Server 5.7\lib/mysqlclient.lib(clientlib.dir/RelWithDebInfo/libmysql.obj):(.xdata[$unwind$mysql_stmt_store_result]+0xc): undefined reference to `__GSHandlerCheck'
答案 0 :(得分:0)
链接应用程序时需要指定-lmysqlclient
。 -L
标志仅更改库搜索路径;它实际上并没有链接任何图书馆。