Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile own Analyzer with MSVC with wrong order of includes #198

Open
xlazom00 opened this issue Jun 15, 2023 · 0 comments
Open

Can't compile own Analyzer with MSVC with wrong order of includes #198

xlazom00 opened this issue Jun 15, 2023 · 0 comments

Comments

@xlazom00
Copy link

xlazom00 commented Jun 15, 2023

I am on windows with MSVC 2019 compiler
I have class like this

//#include <Lucene.h>
#include <Analyzer.h>

class LucenePlusPlusNGramAnalyzer : public Lucene::Analyzer
{
public:
    LucenePlusPlusNGramAnalyzer( int32_t n, bool truncate )
{
}
Lucene::TokenStreamPtr tokenStream( const Lucene::String & fieldName, const Lucene::ReaderPtr & reader ) override
{
return {};
}

}

And compiler get me this:

1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\Collection.h(19,27): error C3861: 'LuceneSync': identifier not found
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\Collection.h(202): message : see reference to class template instantiation 'Lucene::Collection' being compiled
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\Map.h(17,20): error C3861: 'LuceneSync': identifier not found
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\Map.h(126): message : see reference to class template instantiation 'Lucene::Map<KEY,VALUE,LESS>' being compiled
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\Set.h(17,20): error C3861: 'LuceneSync': identifier not found
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\Set.h(129): message : see reference to class template instantiation 'Lucene::Set<TYPE,LESS>' being compiled
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\HashMap.h(17,24): error C3861: 'LuceneSync': identifier not found
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\HashMap.h(126): message : see reference to class template instantiation 'Lucene::HashMap<KEY,VALUE,HASH,EQUAL>' being compiled
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\HashSet.h(17,24): error C3861: 'LuceneSync': identifier not found
1>d:_WORK\qt651_x64\LucenePlusPlus\bin\include\lucene++\HashSet.h(110): message : see reference to class template instantiation 'Lucene::HashSet<TYPE,HASH,EQUAL>' being compiled

when I uncomment Lucene.h all works fine
And I also get same compile error when I move #include <Lucene.h> after #include <Analyzer.h>

Any idea why I need to include Lucene.h as first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant