Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

WwWXxX, udp high ports, d-link extract firmware dsl-2750u, wwwwxxxxx.2G, yxxxcom, WWWXXX, ftp://192.168.100.100, wwwxxx 100, www.xxxcon, wwwxxx

Links

XODOX
Impressum

#1: cygwin strangeness

Posted on 2003-02-15 03:22:29 by ajkormann

I posted this to the win32 list and didn't get a response yet. Hopefully
someone can help me.

Config information:
Hardware: P3-500
Software:
Windows 98
cygwin / bash 2.05b.0(8)-release (i686-pc-cygwin)
g++ using gcc version 3.2 20020927
mysql 3.23.55-max-debug for Win32/Win98 on i32 (executables off the
web-site)

I've even tried compiling with the libraries specified on the web-site
with the same results. This same source-code works fine on Linux.

Two problems:
1 - Cannot use load_defaults. I look for it and find it in
libmysqlclient.lib, but if I link against it I get alot of errors (see
following: NoLoadDefault.txt). I am able to link fine using libmySQL.lib
but there is no load_defaults available.

2 - mysql_fetch_row() seems to be returning invalid MYSQL_ROW values. I
have a query which returns back 100 rows using mysql_store_results(). I
can tell this by looking at mysql_affected_rows() and the SQL is correct
when executed in mysql. I am able to print a value for the first row,
but it's not correct, then when attempting to access the second row, I
get a seg-fault. To add to the strangeness, I have a control variable
fldCnt which is assigned to 0; I print the value before I enter a
for-loop to display the number of fields and columns. When I get into
the for-loop, the value changes. I'm also attaching the file - forgive
the obvious spastic debugging.

Any suggestions?

Thanks in advance.

--
Amy and Joseph Kormann

NoLoadDefault.txt:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
g++ -c InsertMatrix.C -I/usr/include/mysql -I/cygdrive/c/mysql/include
In file included from /usr/include/c++/3.2/backward/iostream.h:31,
from InsertMatrix.C:10:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning
This file includes at least one deprecated or antiquated header. Please
consider using one of the 32 headers found in section 17.4.1.2 of the
C++ standard. Examples include substituting the <X> header for the <X.h>
header for C++ includes, or <sstream> instead of the deprecated header
<strstream.h>. To disable this warning use -Wno-deprecated.
g++ -c ConnectionManager.C -I/usr/include/mysql -I/cygdrive/c/mysql/include
In file included from /usr/include/c++/3.2/backward/iostream.h:31,
from ConnectionManager.C:1:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning
This file includes at least one deprecated or antiquated header. Please
consider using one of the 32 headers found in section 17.4.1.2 of the
C++ standard. Examples include substituting the <X> header for the <X.h>
header for C++ includes, or <sstream> instead of the deprecated header
<strstream.h>. To disable this warning use -Wno-deprecated.
g++ -o InsertMatrix -L/cygdrive/c/mysql/lib/opt -lmysqlclient -mt
InsertMatrix.o ConnectionManager.o
InsertMatrix.o(.text+0xbe):InsertMatrix.C: multiple definition of `_main'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/select_t est.obj)(.text+0x0):D:\mysql-3.23.55\c:
first defined here
Warning: resolving _mysql_query by linking to _mysql_query@8
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _mysql_error by linking to _mysql_error@4
Warning: resolving _mysql_errno by linking to _mysql_errno@4
Warning: resolving _mysql_close by linking to _mysql_close@4
Warning: resolving _mysql_real_connect by linking to _mysql_real_connect@32
Warning: resolving _mysql_init by linking to _mysql_init@4
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/select_t est.obj)(.text+0x18):D:\mysql-3.23.55\c:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/select_t est.obj)(.text+0x76):D:\mysql-3.23.55\c:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/select_t est.obj)(.text+0xf7):D:\mysql-3.23.55\c:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/select_t est.obj)(.text+0x117):D:\mysql-3.23.55\c:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x3c):D:\mysql-3.23.55\l:
undefined reference to `_getservbyname@8'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x4a):D:\mysql-3.23.55\l:
undefined reference to `_ntohs@4'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x234):D:\mysql-3.23.55\l:
undefined reference to `_socket@12'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x24e):D:\mysql-3.23.55\l:
undefined reference to `_WSAGetLastError@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x341):D:\mysql-3.23.55\l:
undefined reference to `_inet_addr@4'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x3d3):D:\mysql-3.23.55\l:
undefined reference to `_htons@4'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x406):D:\mysql-3.23.55\l:
undefined reference to `_WSAGetLastError@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x10):D:\mysql-3.23.55\l:
undefined reference to `_connect@12'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x6):D:\mysql-3.23.55\l:
undefined reference to `__chkstk'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x98):D:\mysql-3.23.55\l:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x18c):D:\mysql-3.23.55\l:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/libmysql .obj)(.text+0x227):D:\mysql-3.23.55\l:
undefined reference to `_WSAGetLastError@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/violite. obj)(.text+0x1):D:\mysql-3.23.55\s:
undefined reference to `_WSAGetLastError@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/violite. obj)(.text+0x40):D:\mysql-3.23.55\s:
undefined reference to `_recv@16'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/violite. obj)(.text+0x40):D:\mysql-3.23.55\s:
undefined reference to `_send@16'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/violite. obj)(.text+0x33):D:\mysql-3.23.55\s:
undefined reference to `_setsockopt@20'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/violite. obj)(.text+0x1):D:\mysql-3.23.55\s:
undefined reference to `_WSAGetLastError@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/violite. obj)(.text+0x36):D:\mysql-3.23.55\s:
undefined reference to `_shutdown@8'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/violite. obj)(.text+0x45):D:\mysql-3.23.55\s:
undefined reference to `_closesocket@4'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/violite. obj)(.text+0x37):D:\mysql-3.23.55\s:
undefined reference to `_getpeername@12'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_mallo c.obj)(.text+0x20):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_thr_i nit.obj)(.text+0x11):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_thr_i nit.obj)(.text+0x1e):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_init. obj)(.text+0x20):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_init. obj)(.text+0x2b):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_init. obj)(.text+0x67):D:\mysql-3.23.55\m:
undefined reference to `_WSACleanup@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_init. obj)(.text+0x17):D:\mysql-3.23.55\m:
undefined reference to `_WSAStartup@8'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_init. obj)(.text+0x20):D:\mysql-3.23.55\m:
undefined reference to `_WSACleanup@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_init. obj)(.text+0x34):D:\mysql-3.23.55\m:
undefined reference to `_WSACleanup@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_init. obj)(.text+0x40):D:\mysql-3.23.55\m:
undefined reference to `_WSAStartup@8'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/password .obj)(.text+0xa9):D:\mysql-3.23.55\l:
undefined reference to `__ftol'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/password .obj)(.text+0xda):D:\mysql-3.23.55\l:
undefined reference to `__ftol'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/password .obj)(.text+0x94):D:\mysql-3.23.55\l:
undefined reference to `__ftol'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/password .obj)(.text+0xcf):D:\mysql-3.23.55\l:
undefined reference to `__ftol'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/charset. obj)(.text+0x20):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/charset. obj)(.text+0x2e):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/charset. obj)(.text+0x80):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/charset. obj)(.text+0x8d):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_getho stbyname.obj)(.text+0x12):D:\mysql-3.23.55\m:
undefined reference to `_gethostbyname@4'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_getho stbyname.obj)(.text+0x19):D:\mysql-3.23.55\m:
undefined reference to `_WSAGetLastError@0'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x2b2):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x6):D:\mysql-3.23.55\m:
undefined reference to `__chkstk'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x149):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x157):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x1b7):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x1c6):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x242):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x250):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x2d2):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x2e0):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x311):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x320):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x44d):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x481):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x38):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x107):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x137):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/default. obj)(.text+0x156):D:\mysql-3.23.55\m:
more undefined references to `__iob' follow
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_open. obj)(.text+0x22):D:\mysql-3.23.55\m:
undefined reference to `_sopen'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_open. obj)(.text+0x22):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_open. obj)(.text+0x3a):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_open. obj)(.text+0xcd):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_read. obj)(.text+0x11):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_read. obj)(.text+0x35):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_read. obj)(.text+0x3f):D:\mysql-3.23.55\m:
more undefined references to `__errno' follow
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_error .obj)(.text+0x90):D:\mysql-3.23.55\m:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_error .obj)(.text+0x9e):D:\mysql-3.23.55\m:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_reall oc.obj)(.text+0x56):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_net.o bj)(.text+0x11):D:\mysql-3.23.55\m:
undefined reference to `_inet_ntoa@4'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_winth read.obj)(.text+0x4a):D:\mysql-3.23.55\m:
undefined reference to `__beginthread'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_winth read.obj)(.text+0x6c):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_winth read.obj)(.text+0x1):D:\mysql-3.23.55\m:
undefined reference to `__endthread'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/str2int. obj)(.text+0x66):D:\mysql-3.23.55\s:
undefined reference to `__isctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/str2int. obj)(.text+0x74):D:\mysql-3.23.55\s:
undefined reference to `__pctype'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/str2int. obj)(.text+0x105):D:\mysql-3.23.55\s:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/str2int. obj)(.text+0x171):D:\mysql-3.23.55\s:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/str2int. obj)(.text+0x1ab):D:\mysql-3.23.55\s:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/str2int. obj)(.text+0x1cc):D:\mysql-3.23.55\s:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/str2int. obj)(.text+0x1ed):D:\mysql-3.23.55\s:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_messn c.obj)(.text+0x1):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_messn c.obj)(.text+0x16):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_messn c.obj)(.text+0x2e):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_messn c.obj)(.text+0x39):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_messn c.obj)(.text+0x4f):D:\mysql-3.23.55\m:
undefined reference to `__iob'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_messn c.obj)(.text+0x5a):D:\mysql-3.23.55\m:
more undefined references to `__iob' follow
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_getwd .obj)(.text+0x47):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_getwd .obj)(.text+0x57):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_getwd .obj)(.text+0x31):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_getwd .obj)(.text+0x48):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_fopen .obj)(.text+0xdf):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_fopen .obj)(.text+0x2a):D:\mysql-3.23.55\m:
more undefined references to `__errno' follow
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_lib.o bj)(.text+0x66):D:\mysql-3.23.55\m:
undefined reference to `__findfirst'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_lib.o bj)(.text+0x135):D:\mysql-3.23.55\m:
undefined reference to `__findnext'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_lib.o bj)(.text+0x20a):D:\mysql-3.23.55\m:
undefined reference to `__findclose'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_lib.o bj)(.text+0x223):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_lib.o bj)(.text+0x239):D:\mysql-3.23.55\m:
undefined reference to `__findclose'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_lib.o bj)(.text+0x24b):D:\mysql-3.23.55\m:
undefined reference to `__errno'
/cygdrive/c/mysql/lib/opt/mysqlclient.lib(./release/my_lib.o bj)(.text+0x43):D:\mysql-3.23.55\m:
undefined reference to `__errno'
Info: resolving ___mb_cur_max by linking to __imp____mb_cur_max
(auto-import)
collect2: ld returned 1 exit status
make: *** [InsertMatrix] Error 1

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

MatrixAvg.C
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Test for inserting a value into the database
// We'll use the table 'matrix' for this. It has 3 values:
// col : tinyint(3)
// row : tinyint(3)
// val : int(11)

#include <stdio.h>
#include "ConnectionManager.h"
#include <mysql.h>
#include <iostream.h>
#include <stdlib.h>

MYSQL *conn;

int RunQuery(MYSQL* conn, char* query)
{
if (mysql_query(conn, query))
{
ConnectionManager::PrintError(conn, "**Query failed**\n\n");
return 1;
}
else
{
// printf("query '%s' success\n", query);
}
return 0;
}

void DisplayMatrixResults(MYSQL_RES* resSet)
{
// mysql_data_seek(resSet, 0);
MYSQL_ROW row;
while ((row = mysql_fetch_row(resSet)) != NULL)
{
unsigned int fldCnt = 0;
printf("fldCnt: %u\n", fldCnt);
for (fldCnt = 0 ;
fldCnt < mysql_num_fields(resSet) ;
++fldCnt)
{
printf("fldCnt: %u\n", fldCnt);
// printf("column %u: value %s\n",
// fldCnt, (row[fldCnt] == NULL ? "NULL" : "not null"));
}

printf("num columns: %i\n", mysql_num_fields(resSet));
// printf("%s\t%s\n", (row[0] != NULL ? row[0] : "NULL"),
// (row[1] != NULL ? row[1] : "NULL"));
printf("before print\n");
// printf("%s\t%s\n", row[0], row[1]);
if (row == NULL)
printf("row is null");
printf("address of row: %d\n", row);
// printf("row[0]: %s\n", row[0]);
// printf("row[1]: %s\n", row[1]);
}
}

int main(int argc, char* argv[])
{
ConnectionManager connMgr;
conn = connMgr.Connect();

// Use the right database
if (RunQuery(conn, "use db_db") != 0)
{
printf("No database!\n");
exit(1);
}

// create a query string, 255 in length
char* sqlString = (char*)malloc(sizeof(char)*255);
sprintf(sqlString,"%s","select row, avg(val) from matrix group by row
order by row");
if (RunQuery(conn, sqlString) == 0)
{
MYSQL_RES* resSet = mysql_store_result(conn);
if (resSet == NULL)
{
ConnectionManager::PrintError(conn, "Problem processing result set");
}
printf("%lu rows returned\n", (unsigned long)
mysql_affected_rows(conn));
// printf("field count: %u\n", mysql_field_count(conn));
DisplayMatrixResults(resSet);
if (resSet != NULL)
mysql_free_result(resSet);
}
else
{
ConnectionManager::PrintError(conn, "Exiting!");
return (1);
}
connMgr.Close(conn);
return(0);
}

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

--
Amy and Joseph Kormann




------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <mysql-thread132452@lists.mysql.com>
To unsubscribe, e-mail <mysql-unsubscribe-gcdmg-mysql=m.gmane.org@lists.mysql.com>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Report this message

#2: Re: cygwin strangeness

Posted on 2003-02-19 01:22:59 by ajkormann

Feels strange being the only one replying to myself, but I'm hoping that
someone will come up with a suggestion if I keep posting what I'm doing.

I've downloaded the version of cygwin that is suggested on the mysql
download page. I re-compiled my programs using the cygwin version and
the one still has the same problems. It's only during the reading of the
data back from the MySQL database. The other option is to go from 3.X to
4.X and see if the problems are fixed. Is that another dead-end path or
is there a simple solution I'm missing? I need to get this running for a
school project.

Thanks,
Joseph

--
Amy and Joseph Kormann





------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail win32-thread10569@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail win32-unsubscribe@lists.mysql.com instead.

Report this message