I'm trying to use MySQL with Visual Studio 2010. I've added the MySQL include directory:
C:\Program Files\MySQL\MySQL Server 5.5\include
...to the project properties under VC++ Directories -> Include Directories.
And added:
C:\Program Files\MySQL\MySQL Server 5.5\lib
&
C:\Program Files\MySQL\MySQL Server 5.5\lib\debug
...to VC++ Directories -> Library Directories.
It was working a couple of days ago, but has now stopped working with the following error:
fatal error LNK1120: 7 unresolved externals
Can anyone help, thanks.
UPDATE: Removed the C:\Program Files\MySQL\MySQL Server 5.5\lib\debug directory from the Include driectories and then added the following lib files to the Linker -> additional dependencies:
C:\Program Files\MySQL\MySQL Server 5.5\lib\mysqlclient.lib C:\Program Files\MySQL\MySQL Server 5.5\lib\libmysql.lib
This genertaes the following errors:
1>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(dosmap.obj) : error LNK2005: __errno already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(file.obj) : error LNK2005: __iob_func already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj) 1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(winsig.obj) : error LNK2005: signal already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_a already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMT.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(atox.obj) : error LNK2005: atoi already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(errmode.obj) : error LNK2005: __set_app_type already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(strtol.obj) : error LNK2005: _strtol already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(strtol.obj) : error LNK2005: _strtoul already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(strnicmp.obj) : error LNK2005: __strnicmp already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(osfinfo.obj) : error LNK2005: __get_osfhandle already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMT.lib(osfinfo.obj) : error LNK2005: __open_osfhandle already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library 1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library