From: Chris R. <cro...@ho...> - 2003-01-07 06:06:09
|
Seem like there's a lot of sloppy coding and not much quality control on this project. Here are the changes I made to get it to compile (sorry it's not in the form of a patch...). Didn't do me any good; I still can't get Pilot-DB to read databases generated by csv2pdb, and the pre-built DOS csv2pdb doesn't work either. (see below for my test cases). To build under UNIX (Mac OS X 10.2 in my case:) 1. All files in the tarball have lines ending in CR-LF (an MS-DOS-ism) which seems to cause problems on some unices (like OSX). I stripped out the trailing ^M's of all the files with a simple script, something like: #!/bin/sh for f in `find . -type f -print` ; do tr -d '\015' <$f > foo mv foo $f done 2. I also had to "chmod +x configure config.sub". That let me do a "./configure" and a "make". 3. I had to add #include <time.h> to libsupport/strop.cpp to get rid of "forward declaration of `struct StrOps::tm'" error. 4. I had to fix a lot of comparison between signed and unsigned errors: (the -Werror flag they're using forces gcc to treat them as errors -- a good idea, but I don't understand then why there are so many problems with this release!). Basically change the variable declaration to be unsigned instead of int. Also, there were a bunch of scoping problems where variable 'j' was being used outside of its scope (looks like somebody doesn't understand the concept of scope...) libsupport/csvfile.cpp, line 120 libflatfile/Database.cpp, line 146 libflatfile/OldDB.cpp: line 210: get rid of the "int" declaration of j and move it to line 144 (as unsigned) libflatfile/MobileDB.cpp: line 454: move j's declaration to line 363 (as unsigned). libflatfile/ListDB.cpp: line 150 same again; move j's declaration to function scope libflatfile/JFile3.cpp:316 same again With gcc 3.1, I couldn't get it to compile; I got: In file included from clp.cpp:1: clp.h:21: looser throw specifier for `virtual CLP::option_error::~option_error()' clp.h:16: overriding `virtual CLP::parse_error::~parse_error() throw ()' which I'm at a loss to figure out... With gcc 2.95, I got it to compile, but I had to get a version of sstream from: http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00700/sstream which I had to edit to typecast the signed/unsigned comparison on line 171: if( buf.size() - rpos != (unsigned) n) ---------------------- After all that, it compiles and runs, but it doesn't WORK! The db generated by csv2pdb isn't able to be read by DB (v1.1b1 db-standard): I get an "Unable to open database." dialog. pdb2csv can read it fine however. Here are my test files: ============= Test.info ============= title "Test" field "Category" string field "Item" string view "Category" "Category" 46 "Item" 30 csvfile "Test.csv" ============= Test.csv ============= "Car","Brush" "Car","Coolers" "Engines","Helmets" "Engines","Oil" "Engines","Gas" "Bike","Clothes" ========================== -- Chris |