+paulinodemoura: You are linking with the wrong version of libmysql.lib. Since you are compilingin Win32 you need 32 bits libmysql.lib. See the last note in http://collab.kpsn.org/display/tc/Win#Win-ConfiguringandGeneratingVisualC++solutionswithCMake