From: Gary K. <gbo...@ya...> - 2006-12-15 14:20:05
|
OK Well I think there are some windows compile scripts that you can use to compile the library for windows with the Borland C compiler. Maybe try that Igor Vitorio Custodio <ig...@bo...> wrote: 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:233, from xbase64.cpp:51: /home/igorvc/dbf/xbase64-3.1.2/xbase64/xbfilter.h:47:14: warning: extra tokens 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ório Custódio (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 /* 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 first I > need to read it. > > I downloaded the 2.0.0 version of XBase and I'm developing in Slackware > Linux with gcc 3.4.6. I installed and runned the example programs fine. > > 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 STDOUT. > > 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 = MyFile.OpenDatabase( "MYFILE.DBF" )) != XB_NO_ERROR ) > { > cout << "\nError opening file rc = " << rc << "\n"; > exit(1); > } > > > docNumber = MyFile.GetFieldNo( "NUMMEDICO" ); > clientRegist = MyFile.GetFieldNo( "PRONTUARIO" ); > clientNumber = MyFile.GetFieldNo( "NUMCLIENTE" ); > chkSum = 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 = MyFile.GetFirstRecord(); > while( rc == XB_NO_ERROR ) > { > rc = MyFile.GetNextRecord(); > memoSize = MyFile.GetMemoFieldLen( clientRegist ); > cout << " Memo Size = " << memoSize ; > xbShort erro = 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 = MyFile.PackDatabase( F_SETLKW )) != XB_NO_ERROR ) > cout << "\nError packing database rc = " << 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 = 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ório Custódio (igorvc) > ' v ' PLACA - ENC 03 - UFSCar > / / \ \ E-Mail: ig...@bo... > / ( ) \ http://www.igor.uni.cc > ^ ` ~ ' ^ Linux User: #322156 > > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ XDB-users mailing list XDB...@li... https://lists.sourceforge.net/lists/listinfo/xdb-users __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |