smilingthax / cttrie

Compile-time TRIE based string matcher (C++11)
50 stars 3 forks source link

Source Files Not Compiling in Eclipse #1

Closed aaronliu0130 closed 2 years ago

aaronliu0130 commented 5 years ago

Eclipse Version: Oxygen.3a.Release (4.7.3a) Errors:

19:23:39 **** Incremental Build of configuration Debug for project cuddly-system ****
make all 
Building file: ../RichmanMA.cpp
Invoking: Cross G++ Compiler
g++ -include"/Users/Aaron/git/cuddly-system/libs/utils.h" -include"/Users/Aaron/git/cuddly-system/libs/cstr.h" -include"/Users/Aaron/git/cuddly-system/libs/cttrie_sw256.tcc" -include"/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc" -include"/Users/Aaron/git/cuddly-system/libs/cttrie.h" -include"/Users/Aaron/git/cuddly-system/libs/getindex.h" -include"/Users/Aaron/git/cuddly-system/libs/stringview.h" -O1 -g3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"RichmanMA.d" -MT"RichmanMA.o" -o "RichmanMA.o" "../RichmanMA.cpp"
In file included from <built-in>:3:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw256.tcc:10:9: error: no template named 'index_sequence'; did you mean 'CtTrie::detail::index_sequence'?
typedef index_sequence<
        ^~~~~~~~~~~~~~
        CtTrie::detail::index_sequence
/Users/Aaron/git/cuddly-system/libs/cttrie.h:44:10: note: 'CtTrie::detail::index_sequence' declared here
  struct index_sequence {};
         ^
In file included from <built-in>:3:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw256.tcc:23:23: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
constexpr Next select(Transition<Char,Next>)
                      ^~~~~~~~~~
                      CtTrie::Transition
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:3:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw256.tcc:27:11: error: unknown type name 'nil'
constexpr nil select(...)
          ^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw256.tcc:33:37: error: no template named 'index_sequence'; did you mean 'CtTrie::detail::index_sequence'?
constexpr auto mkidx(TrieNode trie, index_sequence<Is...>)
                                    ^~~~~~~~~~~~~~
                                    CtTrie::detail::index_sequence
/Users/Aaron/git/cuddly-system/libs/cttrie.h:44:10: note: 'CtTrie::detail::index_sequence' declared here
  struct index_sequence {};
         ^
In file included from <built-in>:3:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw256.tcc:42:26: error: use of undeclared identifier 'nil'
template<> struct is_nil<nil> {
                         ^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw256.tcc:49:26: error: C++ requires a type specifier for all declarations
constexpr auto checkTrie(nil, Stringview&& str, FnE&& fne, Fns&&... fns)
                         ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:41:1: error: no template named 'TrieNode'; did you mean 'CtTrie::TrieNode'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:6:49: note: expanded from macro 'XTMPLATE'
  auto Switch(unsigned char ch,Stringview&& str,TrieNode< \
                                                ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:34:8: note: 'CtTrie::TrieNode' declared here
struct TrieNode : Transitions... {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:41:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:41:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:44:1: error: no template named 'TrieNode'; did you mean 'CtTrie::TrieNode'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:6:49: note: expanded from macro 'XTMPLATE'
  auto Switch(unsigned char ch,Stringview&& str,TrieNode< \
                                                ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:34:8: note: 'CtTrie::TrieNode' declared here
struct TrieNode : Transitions... {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:44:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:44:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:44:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:47:1: error: no template named 'TrieNode'; did you mean 'CtTrie::TrieNode'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:6:49: note: expanded from macro 'XTMPLATE'
  auto Switch(unsigned char ch,Stringview&& str,TrieNode< \
                                                ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:34:8: note: 'CtTrie::TrieNode' declared here
struct TrieNode : Transitions... {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:47:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:47:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:47:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:47:1: error: no template named 'Transition'; did you mean 'CtTrie::Transition'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:7:12: note: expanded from macro 'XTMPLATE'
    XBLOCK(XSUB2,XCOMMA) \
           ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:30:8: note: 'CtTrie::Transition' declared here
struct Transition {};
       ^
In file included from <built-in>:4:
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:50:1: error: no template named 'TrieNode'; did you mean 'CtTrie::TrieNode'?
XTMPLATE
^
/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc:6:49: note: expanded from macro 'XTMPLATE'
  auto Switch(unsigned char ch,Stringview&& str,TrieNode< \
                                                ^
/Users/Aaron/git/cuddly-system/libs/cttrie.h:34:8: note: 'CtTrie::TrieNode' declared here
struct TrieNode : Transitions... {};
       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [RichmanMA.o] Error 1

19:23:41 Build Finished (took 1s.398ms)

You can workaround it by not including the files. By the way, the eclipse parser complains about this: image Edit: When you add the optimization flag, eclipse does not complain, but the compiler still complains the same thing. I also updated the compiler output accordingly.(I almost thought optimization broke it because there were so much complaints even with printf!)

aaronliu0130 commented 5 years ago

Just a quick note: I use macOS, which means that g++ and gcc are just aliases for clang++ and clang .

smilingthax commented 5 years ago

g++ -include"/Users/Aaron/git/cuddly-system/libs/utils.h" -include"/Users/Aaron/git/cuddly-system/libs/cstr.h" -include"/Users/Aaron/git/cuddly-system/libs/cttrie_sw256.tcc" -include"/Users/Aaron/git/cuddly-system/libs/cttrie_sw32.tcc" -include"/Users/Aaron/git/cuddly-system/libs/cttrie.h" -include"/Users/Aaron/git/cuddly-system/libs/getindex.h" -include"/Users/Aaron/git/cuddly-system/libs/stringview.h" ...

The .tcc-files are not meant to be included by the user. They are internally included by cttrie.h. For most cases including just cttrie.h should be enough.