Computers make me cry. I've been trying to compile a tool called YASMET for several days (on and off). Here's what it is doing to me:
1. I run the g++ compiler. It complains about not finding a file called hash_map. So I locate hash_map and now run again, forcing the compiler to include the path to hash_map, as shown here:
bash-3.00$ g++ -I /usr/include/c++/3.3.4/ext YASMET1.cc
In file included from YASMET1.cc:18:
/usr/include/c++/3.3.4/ext/hash_map:65:31: error: ext/stl_hashtable.h: No such file or directory
.... many more errors ensue....
2. I say to myself, 'ok let's locate this little stl_hashtable.h file'. Watch:
bash-3.00$ locate stl_hashtable
/usr/include/c++/3.3.4/ext/stl_hashtable.h
/usr/include/c++/3.2.3/ext/stl_hashtable.h
3. I start crying.
Wednesday, July 9, 2008
Subscribe to:
Post Comments (Atom)


3 comments:
Usually I start step 1. with crying when I have to debug C++.
The YASMET page lists a version YASMET2.cc that is more gcc friendly. Key changes are that you need to include
#include <ext/hash_map>
instead of
#include <hash_map>
and you need to add
using __gnu_cxx::hash_map;using __gnu_cxx::hash;
I was able to compile YASMET2.cc directly using g++ 4.2.3.
g++ YASMET2.cc -o YASYES
./YASYES -h
It looks like there are a few functional changes too between the two versions, but I'm not sure how significant they are. You may want to run
diff YASMET1.cc YASMET2.cc if you have problems running the code.
If it still won't compile let me know your g++ --version number. I've gone through a number of hellish errors when upgrading various g++ versions (I'm looking at you gcc 3.4 and 4.2)
This code certainly looks like it was written by an engineer (or perhaps a robot, which is pretty much the same thing). Would white space, indenting, and a few comments really kill you?
Thanks Andy, I knew you would save the day! :) I'll try YASMET2 and see how it goes.
And LOL on the code.. I talked to someone in my lab who said that Franz Och is notorious for writing code like that.
Post a Comment