473,385 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Re: Errors when trying to use a toolkit

Hello Paavo, thanks for your kind reply. You may certainly be right,
since it appears the author last worked on this toolkit back in 2006.
I wish I knew more about templates, unfortunately I'm just doing the
transition between C and C++..so I'm lost here..Could you check if the
code contains any obvious inaccuracies?
This is an extract from meeevent.hpp:

//-----------------------
#include <ext_algorithm.hpp>

#include "eventspace.hpp"
//...
namespace maxent {
using namespace std;

namespace me {
// Maxent Event
struct Event {
...
}
typedef size_t outcome_id_type;
typedef std::string feature_type;
typedef std::string outcome_type;

typedef EventSpace<me::EventMEEventSpace; //line 97 ERROR
typedef MEEventSpace::featmap_type FeatMapType; //line 98 ERROR

typedef ItemMap<feature_typePredMapType;
typedef ItemMap<outcome_typeOutcomeMapType;
...
} // namespace me
} // namespace maxent

These are the related errors:
/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’

The only thing I can spot from this is that it's having problems with
that EventSpace class (line 97). It's not defined anywhere before in
the file. BUT there's that "#include eventspace.hpp"..the problem is,
I DON't have this file in the /usr/local/include/maxent directory!
"make config" didn't copy it there...going back to the unpacked tar in
my home directory, where "eventspace.hpp" still is, I opened it and
indeed found the class definition. What do you think? May it be the
case? Should I try to copy this and other related files manually into /
usr/local/include/maxent? Or would this screw everything even more?

Thanks so much for your help
Giuseppe

On 7 Giu, 18:18, Paavo Helde <nob...@ebi.eewrote:
The header seems to contain templates, right? My guess would be that this
maxent library is not fully standard-conformant and does not compile
under a recent compiler version which follows the standard template
parsing rules much more exactly than earlier versions. In particular, all
symbol names not dependent of template parameters must be declared
earlier. Also the need of littering the template code with 'typename' and
'template' keywords demanded by the standard has grown over the years.

However, this is just guessing. You could look in this meevent.hpp file,
line 97, find out the symbol which the compiler is complaining about, and
find out where this symbol is declared or defined. If you cannot find out
the problem this way you could try to post the relevant pieces of code
here. *

HTH
Paavo
Jun 27 '08 #1
1 1519
"Giuseppe.G." <gi*************@gmail.comkirjutas:
Hello Paavo, thanks for your kind reply. You may certainly be right,
since it appears the author last worked on this toolkit back in 2006.
I wish I knew more about templates, unfortunately I'm just doing the
transition between C and C++..so I'm lost here..Could you check if the
code contains any obvious inaccuracies?
This is an extract from meeevent.hpp:

//-----------------------
#include <ext_algorithm.hpp>

#include "eventspace.hpp"
//...
If you don't have this header in the proper place, gcc should issue a
warning here. It has always annoyed me that it does not report an error
instead. Yes, it should be probably in the same directory with the
meeevent.hpp. So if it's not there, this is probably a bug in the toolkit
installer. You can copy it manually and see if this helps. BTW, the
"..." include works fine for the includes from the same directory, at
least for all compilers I have seen.

Regards
Paavo

namespace maxent {
using namespace std;

namespace me {
// Maxent Event
struct Event {
...
}
typedef size_t outcome_id_type;
typedef std::string feature_type;
typedef std::string outcome_type;

typedef EventSpace<me::EventMEEventSpace; //line 97 ERROR
typedef MEEventSpace::featmap_type FeatMapType; //line 98 ERROR

typedef ItemMap<feature_typePredMapType;
typedef ItemMap<outcome_typeOutcomeMapType;
...
} // namespace me
} // namespace maxent

These are the related errors:
/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’

The only thing I can spot from this is that it's having problems with
that EventSpace class (line 97). It's not defined anywhere before in
the file. BUT there's that "#include eventspace.hpp"..the problem is,
I DON't have this file in the /usr/local/include/maxent directory!
"make config" didn't copy it there...going back to the unpacked tar in
my home directory, where "eventspace.hpp" still is, I opened it and
indeed found the class definition. What do you think? May it be the
case? Should I try to copy this and other related files manually into
/ usr/local/include/maxent? Or would this screw everything even more?

Thanks so much for your help
Giuseppe

On 7 Giu, 18:18, Paavo Helde <nob...@ebi.eewrote:
>The header seems to contain templates, right? My guess would be that
this maxent library is not fully standard-conformant and does not
compile under a recent compiler version which follows the standard
template parsing rules much more exactly than earlier versions. In
particular, all symbol names not dependent of template parameters
must be declared earlier. Also the need of littering the template
code with 'typename' and 'template' keywords demanded by the standard
has grown over the years.

However, this is just guessing. You could look in this meevent.hpp
file, line 97, find out the symbol which the compiler is complaining
about, and find out where this symbol is declared or defined. If you
cannot find out the problem this way you could try to post the
relevant pieces of code here. *

HTH
Paavo

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mrwoopey | last post by:
Hi, I am using the OLAP data cube in a web browser (using the code from the SQL 2000 toolkit). The OLAP services is on database server and the web interface is on the web server. If we do simple...
0
by: Chive Software | last post by:
Chive Software are pleased to announce a new version of its Apoc PDF Toolkit, part a of its Apoc suite of products. Apoc PDF Toolkit is a high quality software component that developers can add...
10
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
3
by: Leith Bade | last post by:
I have been trying to use the new Visual C++ Toolkit 2003 with the VC6 IDE I set up the executable, inlcude, and library directories to point to the new compilers I had to fix a few errors in the...
10
by: miffy900 | last post by:
Will there be a Visual C++ Toolkit 2005? I really appreciated that there was the Visual C++ 2003 Optimising Compiler distributed for free in the 2003 Toolkit. Will Microsoft continue with this...
1
by: Anders Christensen | last post by:
Hi NG, I'm trying to install The Visualization ToolKit (public.kitware.com/VTK/) on a Solaris 10 machine. I'm using Sun's C/C++ compilers for the purpose. The Makefile generation with ccmake...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, I have an application web ASP.NET 2.0 using ASP.NET AJAX and Ajax Control Toolkit. We need handles errors of AJAX, and I want have only one method that handles those errors (like...
0
by: Giuseppe.G. | last post by:
Hi Greg, you're right about the user include directive. I checked and that's the way it is. Unfortunately I get errors as well using your command line expression. As I was saying into another...
1
by: =?Utf-8?B?SG93YXJkIFBpbnNsZXk=?= | last post by:
I'm trying to convert a Web Site to the Web Application project model and I'm running into compile errors that do not seem to be covered by the guidance I found at "Converting a Web Site Project to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.