List:General Discussion« Previous MessageNext Message »
From:Leif Johnston Date:January 30 2004 1:52pm
Subject:Re: Preparing new lib files
View as plain text  
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;
/*initi MYSQL Structure
/* 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 */

and stack trace (from win2000 server)
Exception: STATUS_ACCESS_VIOLATION at eip=1002DFB1
eax=0022FB98 ebx=00000001 ecx=10251EF4 edx=2D312D53 esi=0022FB98
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" <dnelson@stripped>
To: "Leif Johnston" <leif@stripped>
Cc: <win32@stripped>; <mysql@stripped>
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
> dnelson@stripped

Preparing new lib filesLeif Johnston30 Jan
  • Re: Preparing new lib filesDan Nelson30 Jan
  • Re: Preparing new lib filesLeif Johnston30 Jan