If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mysql c++

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-15-04, 03:26
reijnemans reijnemans is offline
Registered User
 
Join Date: Apr 2004
Location: Netherlands
Posts: 1
Post mysql c++

I've wrote a short program to make a database connection with mysql++ but every time when I try to build the program i get some errors.

Code: main.h
include <iostream>
#include <my_global.h>
#include <mysql.h>

//#include "mysql++-1.7.9\sqlplusint\sqlplus.hh"

#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "wsock32.lib")
#pragma comment(lib, "advapi32.lib")

using namespace std;

Code: main.cpp

#include "main.h"
int main(){
MYSQL mysql;

mysql_init(&mysql);
mysql_options(&mysql,MYSQL_OPT_COMPRESS,0);
mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"odb c");
if (!mysql_real_connect(&mysql,"host","user","passwd" ,"database",0,NULL,0))
{
cout << "er is geen connectie" << endl;
mysql_error(&mysql);
}

return 0;
}

The firts error that I got was:
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\my_global.h(413): fatal error C1083: Cannot open include file: 'my_dbug.h': No such file or directory

I've got all the mysql *.h files from mysql++ but 'my_dbug.h' wasn't there.

So I changed my_dbug.h into dbug.h when I've changed it I get the following errors:
gearproject error LNK2019: unresolved external symbol __beginthread referenced in function _pthread_create
gearproject error LNK2019: unresolved external symbol __endthread referenced in function _pthread_exit

and the output is:
mysqlclient.lib(my_winthread.obj) : error LNK2019: unresolved external symbol __beginthread referenced in function _pthread_create
mysqlclient.lib(my_winthread.obj) : error LNK2019: unresolved external symbol __endthread referenced in function _pthread_exit.

Can somebody help me
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On