10 messages in com.mysql.lists.plusplusRe: "Unresolved external call"| From | Sent On | Attachments |
|---|---|---|
| Patrick Agergaard | 25 Mar 2001 11:51 | |
| Patrick Agergaard | 25 Mar 2001 12:01 | |
| Sinisa Milivojevic | 26 Mar 2001 03:01 | |
| Fredrick Bartlett | 26 Mar 2001 19:01 | |
| Y.Shivakanth | 26 Mar 2001 21:27 | |
| Patrick Agergaard | 27 Mar 2001 12:38 | |
| Clay Daniels | 27 Mar 2001 23:53 | |
| Clay Daniels | 28 Mar 2001 00:04 | |
| Yeoh HS | 28 Mar 2001 00:47 | |
| karn...@eth.net | 28 Mar 2001 01:09 |
| Subject: | Re: "Unresolved external call"![]() |
|---|---|
| From: | Sinisa Milivojevic (sin...@beotel.yu) |
| Date: | 03/26/2001 03:01:55 AM |
| List: | com.mysql.lists.plusplus |
Patrick Agergaard wrote:
Hi
I am trying to compile and link a C++ program on my Win98 system to connect to my (installed) MySQL, but my linked keeps talking about some "unresolved external call" (mysql_real_connect() and mysql_close()).
This is my code:
#include <iostream.h> #include <windows.h>
#include "c:\progra~1\mysql\include\mysql.h"; // #include "F:\MySQL\mysql++1_7_1win32_borland_1_1\include\mysql\mysql.h";
#define def_host_name NULL // host to connect to (default = localhost) #define def_user_name NULL // user name (default = your login name) #define def_password NULL // password (default = none) #define def_db_name NULL // database to use (default = none)
MYSQL *conn; // pointer to connection handler
void main() { cout << "Starting!"; mysql_real_connect ( conn, // pointer to connection handler def_host_name, // host to connect to def_user_name, // user name def_password, // password def_db_name, // database to use 0, // port (use default) NULL, // socket (use default) 0); // flags (none) cout << "Halfway through"; mysql_close (conn); cout << "Finished!"; exit (0); }
It's the lines with mysql_real_connect() and mysql_close() that causes
trouble. I've set the bcc32 up to include MySQL's include and lib directories.
Why won't it link?
Thanks beforehand :o)
Patrick
Hi!
You have to supply user name at least, if on Windows.
--
Regards,
Sinisa
____ __ _____ _____ ___ == MySQL AB /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sin...@mysql.com /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaca, Cyprus /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ /*/ \*\ Developers Team




