From: Igor V. C. <ig...@bo...> - 2006-12-14 20:11:50
|
Hello Gary, I can't compile the xbase64-3.1.2 and xbase Daily snapshot either! The errors: Daily snapshot: /usr/share/aclocal/ORBit.m4:4: warning: underquoted definition of AM_PATH= _ORBIT acinclude.m4:539: error: m4_defn: undefined macro: _m4_divert_diversion autoconf/functions.m4:458: AM_FUNC_ERROR_AT_LINE is expanded from... acinclude.m4:539: the top level autom4te: /usr/bin/m4 failed with exit status: 1 aclocal: autom4te failed with exit status: 1 make: ** [aclocal.m4] Erro 1 xbase64-3.1.2: In file included from /home/igorvc/dbf/xbase64-3.1.2/xbase64/xbase64.h:23= 3, from xbase64.cpp:51: /home/igorvc/dbf/xbase64-3.1.2/xbase64/xbfilter.h:47:14: warning: extra t= okens at end of #ifdef directive xbase64.cpp: In member function `xbShort xbXBase::LockFile(int, xbShort, = xbOffT)': xbase64.cpp:729: error: `errno' was not declared in this scope xbase64.cpp:729: error: `EINTR' was not declared in this scope make[2]: ** [xbase64.lo] Erro 1 make[2]: Leaving directory `/home/igorvc/dbf/xbase64-3.1.2/xbase64' make[1]: ** [all] Erro 2 make[1]: Leaving directory `/home/igorvc/dbf/xbase64-3.1.2/xbase64' make: ** [all-recursive] Erro 1 Thanks ... -- ---- ------- -------- ~ Igor Vit=F3rio Cust=F3dio (igorvc) ' v ' PLACA - ENC 03 - UFSCar / / \ \ E-Mail: ig...@bo... / ( ) \ http://www.igor.uni.cc ^ ` ~ ' ^ Linux User: #322156 Gary Kunkel escreveu: > > Maybe try the latest 3.x version and see if that works for you. > > Gary > > > > */Igor Vitorio Custodio <ig...@bo...>/* wrote: > > Hello! > > I'm having problems with memo fields. > > See the code and explanation about the problem below: > > I have a lot of DBF files that I need to port to Postgres, but firs= t I > need to read it. > > I downloaded the 2.0.0 version of XBase and I'm developing in Slack= ware > Linux with gcc 3.4.6. I installed and runned the example programs f= ine. > > So, I started to code a program, using the example4.cpp like a > example, to > port my DBF file to the database, first writting the result at STDO= UT. > > This is the code: > > // test.cpp > #include > > int main() > { > xbShort rc; > xbShort clientNumber, clientRegist, docNumber, chkSum; > xbLong memoSize ; > char buf[40000]; > xbXBase x; > xbDbf MyFile( &x ); > if(( rc =3D MyFile.OpenDatabase( "MYFILE.DBF" )) !=3D XB_NO_ERROR )= > { > cout << "\nError opening file rc =3D " << rc << "\n"; > exit(1); > } > > > docNumber =3D MyFile.GetFieldNo( "NUMMEDICO" ); > clientRegist =3D MyFile.GetFieldNo( "PRONTUARIO" ); > clientNumber =3D MyFile.GetFieldNo( "NUMCLIENTE" ); > chkSum =3D MyFile.GetFieldNo( "CHKSUM" ); > > cout << "\n Position of NUMCLIENTE -> " << clientNumber > << " Type: " << MyFile.GetFieldType( clientNumber ); > cout << "\n Position of NUMMEDICO -> " << docNumber > << " Type: " << MyFile.GetFieldType( docNumber ); > cout << "\n Position of PRONTUARIO -> " << clientRegist > << " Type: " << MyFile.GetFieldType( clientRegist ); // memo! > cout << "\n Position of CHKSUM -> " << chkSum > << " Type:" << MyFile.GetFieldType( chkSum ); > rc =3D MyFile.GetFirstRecord(); > while( rc =3D=3D XB_NO_ERROR ) > { > rc =3D MyFile.GetNextRecord(); > memoSize =3D MyFile.GetMemoFieldLen( clientRegist ); > cout << " Memo Size =3D " << memoSize ; > xbShort erro =3D MyFile.GetMemoField( 1, 40000, buf, F_SETLK ); > cout << " Error cod. " << erro; > switch (erro) > { > case XB_INVALID_FIELDNO: > cout << "\nAn invalid field number was used"; > break; > case XB_NOT_MEMO_FIELD: > cout << "\nNot a memo field"; > break; > case XB_NO_MEMO_DATA: > cout << "\nNo memo data exists"; > break; > case XB_INVALID_BLOCK_NO: > cout << "\nInternal error, notify tech support"; > break; > case XB_SEEK_ERROR : > cout << "\nDisk Error"; > break; > case XB_READ_ERROR: > cout << "\nDisk Error"; > break; > case XB_NO_ERROR: > cout << "\nNo Error"; > break; > } > > if (MyFile.MemoFieldsPresent()) > cout << "\nTHERE IS a memo register!" << endl; > else > cout << "\nTHERE ISN'T memo register!" << endl; > > > } > > if(( rc =3D MyFile.PackDatabase( F_SETLKW )) !=3D XB_NO_ERROR ) > cout << "\nError packing database rc =3D " << rc; > else > cout << "\n\n\n\nDatabase packed.\n"; > > MyFile.ExclusiveUnlock(); /* unlock the files */ > MyFile.CloseDatabase(); /* close database */ > return 0; > } > > > I compile without problens! > > But see the result at STDOUT: > > Position of NUMCLIENTE -> 0 Type: N > Position of NUMMEDICO -> 2 Type: N > Position of PRONTUARIO -> 1 Type: M > Position of CHKSUM -> 3 Type:C > (...) // a lot of ... > Memo Size =3D 0 Error cod. -134 > No memo data exists > THERE IS a memo register! > (...) > > Can anyone explain why MyFile.MemoFieldsPresent() say that there is= > a memo > field but MyFile.GetMemoField and MyFile.GetMemoFieldLen() don't ??= ?? > > Best regards > > -- > ---- ------- -------- > ~ Igor Vit=F3rio Cust=F3dio (igorvc) > ' v ' PLACA - ENC 03 - UFSCar > / / \ \ E-Mail: ig...@bo... > / ( ) \ http://www.igor.uni.cc > ^ ` ~ ' ^ Linux User: #322156 > > |