moissinac / csvfix

Automatically exported from code.google.com/p/csvfix
MIT License
0 stars 0 forks source link

Make on Ubuntu 9.04 fails #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
cd alib; make
/csvfix/alib
make[1]: Entering directory `/csvfix/alib'
g++ -c -Iinc -Iexpat -o obj/a_chsrc.o src/a_chsrc.cpp  
g++ -c -Iinc -Iexpat -o obj/a_csv.o src/a_csv.cpp  
g++ -c -Iinc -Iexpat -o obj/a_enc.o src/a_enc.cpp  
g++ -c -Iinc -Iexpat -o obj/a_env.o src/a_env.cpp  
g++ -c -Iinc -Iexpat -o obj/a_except.o src/a_except.cpp  
g++ -c -Iinc -Iexpat -o obj/a_expr.o src/a_expr.cpp  
g++ -c -Iinc -Iexpat -o obj/a_myth.o src/a_myth.cpp  
g++ -c -Iinc -Iexpat -o obj/a_inifile.o src/a_inifile.cpp  
g++ -c -Iinc -Iexpat -o obj/a_file.o src/a_file.cpp  
g++ -c -Iinc -Iexpat -o obj/a_rand.o src/a_rand.cpp  
g++ -c -Iinc -Iexpat -o obj/a_time.o src/a_time.cpp  
g++ -c -Iinc -Iexpat -o obj/a_regex.o src/a_regex.cpp  
g++ -c -Iinc -Iexpat -o obj/a_shstr.o src/a_shstr.cpp  
g++ -c -Iinc -Iexpat -o obj/a_slice.o src/a_slice.cpp  
g++ -c -Iinc -Iexpat -o obj/a_sort.o src/a_sort.cpp  
g++ -c -Iinc -Iexpat -o obj/a_str.o src/a_str.cpp  
g++ -c -Iinc -Iexpat -o obj/a_table.o src/a_table.cpp  
g++ -c -Iinc -Iexpat -o obj/a_xmlevents.o src/a_xmlevents.cpp  
g++ -c -Iinc -Iexpat -o obj/a_xmlparser.o src/a_xmlparser.cpp  
g++ -c -Iinc -Iexpat -o obj/a_xmltree.o src/a_xmltree.cpp  
g++ -c -Iinc -Iexpat -o obj/a_date.o src/a_date.cpp  
g++ -c -Iinc -Iexpat -o obj/a_range.o src/a_range.cpp  
g++ -c -Iinc -Iexpat -o obj/xmlparse.o expat/xmlparse.cpp  
g++ -c -Iinc -Iexpat -o obj/xmlrole.o expat/xmlrole.cpp  
g++ -c -Iinc -Iexpat -o obj/xmltok.o expat/xmltok.cpp  
g++ -c -Iinc -Iexpat -o obj/xmltok_impl.o expat/xmltok_impl.cpp  
g++ -c -Iinc -Iexpat -o obj/xmltok_ns.o expat/xmltok_ns.cpp  
ar rvs lib/alib.a obj/a_chsrc.o obj/a_csv.o obj/a_enc.o obj/a_env.o
obj/a_except.o obj/a_expr.o obj/a_myth.o obj/a_inifile.o obj/a_file.o
obj/a_rand.o obj/a_time.o obj/a_regex.o obj/a_shstr.o obj/a_slice.o
obj/a_sort.o obj/a_str.o obj/a_table.o obj/a_xmlevents.o obj/a_xmlparser.o
obj/a_xmltree.o obj/a_date.o obj/a_range.o obj/xmlparse.o obj/xmlrole.o
obj/xmltok.o obj/xmltok_impl.o obj/xmltok_ns.o
ar: creating lib/alib.a
a - obj/a_chsrc.o
a - obj/a_csv.o
a - obj/a_enc.o
a - obj/a_env.o
a - obj/a_except.o
a - obj/a_expr.o
a - obj/a_myth.o
a - obj/a_inifile.o
a - obj/a_file.o
a - obj/a_rand.o
a - obj/a_time.o
a - obj/a_regex.o
a - obj/a_shstr.o
a - obj/a_slice.o
a - obj/a_sort.o
a - obj/a_str.o
a - obj/a_table.o
a - obj/a_xmlevents.o
a - obj/a_xmlparser.o
a - obj/a_xmltree.o
a - obj/a_date.o
a - obj/a_range.o
a - obj/xmlparse.o
a - obj/xmlrole.o
a - obj/xmltok.o
a - obj/xmltok_impl.o
a - obj/xmltok_ns.o
make[1]: Leaving directory `/csvfix/alib'
cd csvfix; make
/csvfix/csvfix
make[1]: Entering directory `/csvfix/csvfix'
g++ -c -Iinc -I../alib/inc -o obj/csved_atable.o src/csved_atable.cpp  
g++ -c -Iinc -I../alib/inc -o obj/csved_case.o src/csved_case.cpp  
g++ -c -Iinc -I../alib/inc -o obj/csved_cli.o src/csved_cli.cpp  
src/csved_cli.cpp: In member function ‘int CSVED::CLIHandler::Usage()’:
src/csved_cli.cpp:110: error: no matching function for call to
‘Max(unsigned int&, size_t)’
make[1]: *** [obj/csved_cli.o] Error 1
make[1]: Leaving directory `/csvfix/csvfix'
make: *** [all] Error 2

With no dependencies listed in readme or info to resolve this, posting this
issue.

Original issue reported on code.google.com by ErikTJac...@gmail.com on 10 Sep 2009 at 3:56

GoogleCodeExporter commented 8 years ago
Firstly, try #including "a_base.h" in the source file csved_cli.cpp - it should 
be
included but currently isn't, at least directly. If that doesn't work, take 
look at
this line in csved_cli.cpp:

width = ALib::Max( width, cmds[j].size() );

You can try changing it to look like this:

width = std::max( width, cmds[j].size() );

which will use the C++ standard library max() template. The ALib version is 
intended
to avoid problems like this, but I guess it has failed :-(

This code has compiled succesfully for me on Fedora and for other people, so I 
am a
bit bemused why it should not work on your version of Ubuntu. 

Could you please post any more questions like this in the support group? I 
don't want
to stop people using the issue tracker, but I feel it is better if issues are
discussed informally before they are entered in the tracker.

Original comment by nbutterworth1953@gmail.com on 12 Sep 2009 at 5:23

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Erik - I forgot to say Thanks Very Much for your very useful input. 

Original comment by nbutterworth1953@gmail.com on 12 Sep 2009 at 5:38

GoogleCodeExporter commented 8 years ago
On mature reflection, and considering the C++ issues involved here, the error:

src/csved_cli.cpp:110: error: no matching function for call to
Max(unsigned int&, size_t)

is probably because templates don't do type conversion and I only provide a 
Max()
function templated on one type. On your version of Ubuntu, a size_t is probably 
not
an unsigned int. The quick and dirty way to fix it is to make it so:

width = ALib::Max( width, (unsigned int) cmds[j].size() );

I will probably go back to using the std::max function in later releases. 
Please let
me know which (if any!) of my suggestions fixes the problem.

Cheers,

NeilB

Original comment by nbutterworth1953@gmail.com on 12 Sep 2009 at 5:58

GoogleCodeExporter commented 8 years ago
Correct, I should have mentioned I was running 64-bite which would make my 
size_t 8
bytes instead of 4.

Casting it as unsigned int did in fact fix it and it correctly builds now.

Thank you for your help!

Original comment by ErikTJac...@gmail.com on 12 Sep 2009 at 10:00

GoogleCodeExporter commented 8 years ago

Original comment by nbutterworth1953@gmail.com on 13 Sep 2009 at 7:09