List:MySQL on Win32« Previous MessageNext Message »
From:Christian Mack Date:June 2 1999 1:47pm
Subject:Re: C-Api Compile Error
View as plain text  
Lew Barnesson wrote:
> 
> Hi,
> 
> I habe been using the C api, mysql 3.22.13-beta-debug.
> 
> This  couldn't be a bug because the program has been working for months,
> that is, up until 2 days ago. The compiler suddenly seems confused about
> usage of the mysql_connect api.
> 
> An excerpt:
> 
>         MYSQL myData, *pmysql=NULL ;
> 
>                - - this statement - -
> 
>         if (pmysql = mysql_connect( &myData, "localhost", "root", NULL) !=
> NULL) {
> 
>                - - Results in the error: Cannot convert 'bool' to 'st_mysql
> *'
> 
> Where is the 'bool'?
> 
> I've re-loaded mysql.h, but no help.
> 
> Any ideas?
> 
> Regards, -Lew

Hi Lew

You have forgotton the paranthesis around the assignment to 'pmysql'.
So it tries to assign the result of 'mysql_connect(..) != NULL' to pmysql :)

Try instead:
...
if ( (pmysql = mysql_connect( &myData, "localhost", "root", NULL )) != NULL ) {
...

Tschau
Christian

Thread
C-Api Compile ErrorLew Barnesson2 Jun
  • Re: C-Api Compile ErrorChristian Mack2 Jun
Re: C-Api Compile ErrorLew Barnesson2 Jun