MySQL Forums
Forum List  »  Source, Builds, Binaries

mysql_init() giving unresolved external symbol error
Posted by: Kirt Stark
Date: October 17, 2014 12:10PM

I'm trying to connect a C++ project in VS 2013 to a MySql database. I have connected the database through the Server Explorer, and the connection tests good. I added the lib folder and include folder paths to the project. I am using the most recent version of the community developer MySql, and have added the database with some data through the MySql Workbench.

The problem is that when I try to compile a short connection test program, I get a compile error:

Error 1 error LNK2019: unresolved external symbol _mysql_init@4 referenced in function _wmain c:\Users\Devon\documents\visual studio 2013\Projects\think3\think3\think3.obj think3

Error 2 error LNK1120: 1 unresolved externals c:\users\devon\documents\visual studio 2013\Projects\think3\Debug\think3.exe 1 1 think3


I have the following code:

#include "stdafx.h"
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

#include <winsock.h>
#include <mysql.h>

int _tmain(int argc, _TCHAR* argv[])
{
MYSQL* conn;
conn = mysql_init(NULL);

return 0;
}


It's probably some little step I've neglected, but I can't find any solutions on the web. Does anyone have some suggestions on how I can resolve this?

Thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
mysql_init() giving unresolved external symbol error
5096
October 17, 2014 12:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.