Comments (6)
That's nasty. I am using VS2015 for my own main OpenFST project, and not getting the error. What toolset are you using? Have you updated Visual Studio to the latest update version (Help/About)?
The problem is there is a bug in the Microsoft compiler, both in VS 2015 and 2017; look how the same line has changed in the original OpenFST (the orig/1.6 branch here). I added the std::remove_reference
although it is not required, only to work around the bug, and this workaround is what giving you the trouble.
from openfst.
For comparison: my Help/About box shows "Version 14.0.25431.01 Update 3", the toolset as selected in the project is "Visual Studio 2015 (v140)", and cl version is 19.00.24215.1. I just checked out fresh project and compiled it. Please check what are yours.
from openfst.
I faced also the same problem.
Although here what I did just to make the compiler happy, although I am not sure if the code will hit at run time or even either it will work as intended.
in the file string-weight.h, you need to modify line 176 from
typename std::remove_reference<decltype (Weight::rest_)>::const_reverse_iterator iter_;
to
typename std::remove_reference<decltype (Weight::rest_)>::type::const_reverse_iterator iter_;
than in top of class StringWeightIterator , line 140, add the following code, this actually implement the comparison operator the compiler is looking for.
static bool operator == (const std::reverse_iterator<std::_List_const_iterator<std::_List_val<std::_List_simple_types<int>>>> & a, std::_List_const_iterator<std::_List_val<std::_List_simple_types<int>>> &b)
{
return a.operator*() == b.operator*();
}
I have visual studio 2015 build 14.0.25431.01 update 3
from openfst.
Fixed, thanks. The issue only occurs when using the template, not when compiling the library itself!
@bahtity, I applied your suggested fix with the missing ::type
, thank you, but the second part escapes me. It does not seem right. Note the left of the comparison if an iterator specialized on an iterator, like it's a reverse_iterator on a container of iterators, not values! I suspect a missing iterator dereference somewhere in the code that calls the library. If you have a piece of code that reproduces this error, please open a new issue!
from openfst.
@kkm000 , you may be right. actually I tried to find the code call this operator but I could not.
I can see your point by trying simplifying the operator code to be like this :
typedef std::_List_simple_types<int> STD_SLT;
typedef std::_List_val<STD_SLT> STD_SLT_V;
typedef std::_List_const_iterator<STD_SLT_V > STD_LCI_SLT_V;
static bool operator == (const std::reverse_iterator <STD_LCI_SLT_V> & a, STD_LCI_SLT_V &b)
{
return a.operator*() == b.operator*();
}
if we assumed that the function of the comparison operator is to compares the value the iterator points to the right implantation would be return *a == *b ;
instead of return a.operator*() == b.operator*();
i tried the final code and it compile correctly.
typedef std::_List_simple_types<int> STD_SLT;
typedef std::_List_val<STD_SLT> STD_SLT_V;
typedef std::_List_const_iterator<STD_SLT_V > STD_LCI_SLT_V;
static bool operator == (const std::reverse_iterator <STD_LCI_SLT_V> & a, STD_LCI_SLT_V &b)
{
return *a == *b;
}
from openfst.
@bahity: Good, thanks for confirming!
from openfst.
Related Issues (20)
- Problem reading FAR file from farcompilestrings HOT 7
- Error reading SymbolTable HOT 3
- ERROR: Unknown file read mode when reading VectorFst HOT 6
- Feature request: Publish package on chocolatey HOT 4
- stdout newline conversion of binary data HOT 13
- About the license of this repo HOT 2
- Building openfst and getting 36 errors, Please help me HOT 2
- Build errors on vector-fst.h line 611 when using Visual Studio 14 2015 HOT 3
- Cannot find source file when building from source with Cmake HOT 9
- Error reading Kaldi's GrammarFst HOT 5
- kkm: Bring the upstream up to date HOT 1
- Implement memory-mapped files
- Build ngram and other extensions HOT 4
- Proposed fixes for building with CMake and Clang-cl on Windows with HAVE_BIN=OFF HOT 7
- Access denied: Unable to start the program .../ALL_BUILD HOT 1
- Can't run on windows-xp HOT 1
- Cannot open include file: 'dlfcn.h': No such file or directory HOT 1
- OpenFST 1.8.0 port HOT 2
- Cross compile error when using mingw. HOT 15
- openfst DLL LoadLibrary stuck HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfst.