OK lesson learned, why .a vs .lib? Strange and scary notion.

I am still ending up with a segmentation fault once I use them as is. Same
is happening in windows side with  code:

#include <stdio.h>
#include <mysql.h>

int main()
{
/* declasre structures and variables.*/
MYSQL mysql;
MYSQL_RES *result;
MYSQL_ROW row;
/*initi MYSQL Structure
mysql_inti(&mysql);
/* connect */
mysql_real_connect(&mysql, "localhost", "leif", "", "bmass", 0, NULL, 0);

/* exec query */
mysql_query(&mysql, "select * from codes");

/* get result set */
result= mysql_store_result(&mysql);

/* process results */
while((row= mysql_fetch_row(result)))
{
fprintf(stdout, " %d - %d - %s\n", row[0], row[1], row[2]);
}

/* clean up */
mysql_free_result(result);
mysql_close(&mysql);
}

and stack trace (from win2000 server)
Exception: STATUS_ACCESS_VIOLATION at eip=1002DFB1
eax=0022FB98 ebx=00000001 ecx=10251EF4 edx=2D312D53 esi=0022FB98
edi=00000000
ebp=0022FDC0 esp=0022F8BC program=C:\cygwin\usr\src\sample.exe
cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023
Stack trace:
Frame     Function  Args
0022FDC0  1002DFB1  (00000001, 10250818, 10250330, 61062452)
0022FF40  61005018  (610CFEE0, FFFFFFFE, 0000003C, 610CFE04)
0022FF90  610052ED  (00000000, 00000000, 8043138F, 00000000)
0022FFB0  00401531  (00401089, 037F0009, 0022FFF0, 7C5987E7)
0022FFC0  0040103C  (00000000, 77F8A900, 7FFDF000, 00000000)
0022FFF0  7C5987E7  (00401000, 00000000, 000000C8, 00000100)
End of stack trace



----- Original Message ----- 
From: "Dan Nelson" <[EMAIL PROTECTED]>
To: "Leif Johnston" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 29, 2004 10:15 PM
Subject: Re: Preparing new lib files


> In the last episode (Jan 29), Leif Johnston said:
> > I have been having trouble under ming, cygwin and Linux all for
> > different reasons and all because some of my libs don't address
> > everything. I downloaded the linux distribution and found all the lib
> > files stored as ".a" files. How do I turn them into libs and can I
> > use the same libs on windows cygwin and linux?
>
> .a files are static libraries.  Each OS requires its own libraries,
> since they may have different types, structure packing rules and
> functions.
>
> -- 
> Dan Nelson
> [EMAIL PROTECTED]
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to