G
Giuseppe.G.
Hello there, hope you will be willing to help me with something that's
really puzzling me. As it will soon be clear, I'm a beginner with
Linux programming, so please bear with me.
I'm working on a linux pc, with ubuntu 8.04, and g++ version Ubuntu
4.2.3-2ubuntu7.
I need to learn and use a machine learning toolkit, maxent
http://homepages.inf.ed.ac.uk/s0450736/maxent_toolkit.html
that provides a framework for using discriminative learning in several
domains, mine being NLP.
Following the manual, I successfully downloaded the package under my
home directory, and installed the toolkit: basically what I did was to
type:
(/home/giu/maxent) ./configure
(/homegiu/maxent/) make
(/home/giu/maxent/) sudo make install
These three operations apparently went well, the output of "make
install" being the following:
Install /usr/local/bin/maxent
Chmod1 /usr/local/bin/maxent
Install /usr/local/lib/libmaxent.a
Chmod1 /usr/local/lib/libmaxent.a
MkDir1 /usr/local/include/maxent
Install /usr/local/include/maxent/maxentmodel.hpp
Chmod1 /usr/local/include/maxent/maxentmodel.hpp
Install /usr/local/include/maxent/itemmap.hpp
Chmod1 /usr/local/include/maxent/itemmap.hpp
Install /usr/local/include/maxent/meevent.hpp
Chmod1 /usr/local/include/maxent/meevent.hpp
Install /usr/local/include/maxent/hash_map.hpp
Chmod1 /usr/local/include/maxent/hash_map.hpp
Install /usr/local/include/maxent/ext_algorithm.hpp
Chmod1 /usr/local/include/maxent/ext_algorithm.hpp
where "maxent" is a commandline program I won't need, while I assume
"libmaxent.a" and all the *.hpp are all the "library" files I will
need to use the toolkit.
The "usage" section in the manual then reports that in order to use
the toolking one must simply add the following in his code:
//-------------------------------
#include <maxent/maxentmodel.hpp>
using namespace maxent;
MaxentModel m;
//-------------------------------
At this point what I do is creating a very basic .cpp file under my
home directory (/home/giu/tempcode/testmaxent.cpp) in which I put
//-----------------------------------------------
#include<iostream>
#include<maxent/maxentmodel.hpp> // is this path correct?
using namespace maxent;
MaxentModel m;
int main(){..}
//-------------------------------------------------
what I get unfortunately is a lot of errors. This is the output of the
compiler:
//-------------------------------------------
In file included from /usr/local/include/maxent/maxentmodel.hpp:42,
from ../src/testmaxent.cpp:3:
/usr/local/include/maxent/meevent.hpp:97: error: expected initializer
before ‘<’ token
/usr/local/include/maxent/meevent.hpp:98: error: ‘MEEventSpace’ has
not been declared
/usr/local/include/maxent/meevent.hpp:98: error: expected initializer
before ‘FeatMapType’
In file included from ../src/testmaxent.cpp:3:
/usr/local/include/maxent/maxentmodel.hpp:204: error: ‘MEEventSpace’
is not a member of ‘maxent::me’
/usr/local/include/maxent/maxentmodel.hpp:204: error: ‘MEEventSpace’
is not a member of ‘maxent::me’
/usr/local/include/maxent/maxentmodel.hpp:204: error: template
argument 1 is invalid
/usr/local/include/maxent/maxentmodel.hpp:205: error: ‘MEEventSpace’
is not a member of ‘maxent::me’
/usr/local/include/maxent/maxentmodel.hpp:205: error: ‘MEEventSpace’
is not a member of ‘maxent::me’
/usr/local/include/maxent/maxentmodel.hpp:205: error: template
argument 1 is invalid
make: *** [src/testmaxent.o] Error 1
//--------------------------------------------------------------------
Any clue on what I'm doing wrong? I tried doing the same thing from
within eclipse, but I get the same output. I even tried right clicking
into the project properties, where some "build path" controls could
probably solve my problem, but I don't have a clue.
Your help would be really appreciated.
Thanks
Giuseppe
really puzzling me. As it will soon be clear, I'm a beginner with
Linux programming, so please bear with me.
I'm working on a linux pc, with ubuntu 8.04, and g++ version Ubuntu
4.2.3-2ubuntu7.
I need to learn and use a machine learning toolkit, maxent
http://homepages.inf.ed.ac.uk/s0450736/maxent_toolkit.html
that provides a framework for using discriminative learning in several
domains, mine being NLP.
Following the manual, I successfully downloaded the package under my
home directory, and installed the toolkit: basically what I did was to
type:
(/home/giu/maxent) ./configure
(/homegiu/maxent/) make
(/home/giu/maxent/) sudo make install
These three operations apparently went well, the output of "make
install" being the following:
Install /usr/local/bin/maxent
Chmod1 /usr/local/bin/maxent
Install /usr/local/lib/libmaxent.a
Chmod1 /usr/local/lib/libmaxent.a
MkDir1 /usr/local/include/maxent
Install /usr/local/include/maxent/maxentmodel.hpp
Chmod1 /usr/local/include/maxent/maxentmodel.hpp
Install /usr/local/include/maxent/itemmap.hpp
Chmod1 /usr/local/include/maxent/itemmap.hpp
Install /usr/local/include/maxent/meevent.hpp
Chmod1 /usr/local/include/maxent/meevent.hpp
Install /usr/local/include/maxent/hash_map.hpp
Chmod1 /usr/local/include/maxent/hash_map.hpp
Install /usr/local/include/maxent/ext_algorithm.hpp
Chmod1 /usr/local/include/maxent/ext_algorithm.hpp
where "maxent" is a commandline program I won't need, while I assume
"libmaxent.a" and all the *.hpp are all the "library" files I will
need to use the toolkit.
The "usage" section in the manual then reports that in order to use
the toolking one must simply add the following in his code:
//-------------------------------
#include <maxent/maxentmodel.hpp>
using namespace maxent;
MaxentModel m;
//-------------------------------
At this point what I do is creating a very basic .cpp file under my
home directory (/home/giu/tempcode/testmaxent.cpp) in which I put
//-----------------------------------------------
#include<iostream>
#include<maxent/maxentmodel.hpp> // is this path correct?
using namespace maxent;
MaxentModel m;
int main(){..}
//-------------------------------------------------
what I get unfortunately is a lot of errors. This is the output of the
compiler:
//-------------------------------------------
In file included from /usr/local/include/maxent/maxentmodel.hpp:42,
from ../src/testmaxent.cpp:3:
/usr/local/include/maxent/meevent.hpp:97: error: expected initializer
before ‘<’ token
/usr/local/include/maxent/meevent.hpp:98: error: ‘MEEventSpace’ has
not been declared
/usr/local/include/maxent/meevent.hpp:98: error: expected initializer
before ‘FeatMapType’
In file included from ../src/testmaxent.cpp:3:
/usr/local/include/maxent/maxentmodel.hpp:204: error: ‘MEEventSpace’
is not a member of ‘maxent::me’
/usr/local/include/maxent/maxentmodel.hpp:204: error: ‘MEEventSpace’
is not a member of ‘maxent::me’
/usr/local/include/maxent/maxentmodel.hpp:204: error: template
argument 1 is invalid
/usr/local/include/maxent/maxentmodel.hpp:205: error: ‘MEEventSpace’
is not a member of ‘maxent::me’
/usr/local/include/maxent/maxentmodel.hpp:205: error: ‘MEEventSpace’
is not a member of ‘maxent::me’
/usr/local/include/maxent/maxentmodel.hpp:205: error: template
argument 1 is invalid
make: *** [src/testmaxent.o] Error 1
//--------------------------------------------------------------------
Any clue on what I'm doing wrong? I tried doing the same thing from
within eclipse, but I get the same output. I even tried right clicking
into the project properties, where some "build path" controls could
probably solve my problem, but I don't have a clue.
Your help would be really appreciated.
Thanks
Giuseppe