std::string _simpHanzi;
std::vector<ExampleSentences> _exampleSentence
|
|
Vocabulary.cpp: In member function 'bool Vocabulary::sentenceIsLonger(const ExampleSentences&, const ExampleSentences&)': Vocabulary.cpp:68: error: passing 'const ExampleSentences' as 'this' argument of 'std::string ExampleSentences::getSimpHanzi()' discards qualifiers Vocabulary.cpp:69: error: passing 'const ExampleSentences' as 'this' argument of 'std::string ExampleSentences::getSimpHanzi()' discards qualifiers Vocabulary.cpp: In member function 'void Vocabulary::sortSentences()': Vocabulary.cpp:78: error: argument of type 'bool (Vocabulary::)(const ExampleSentences&, const ExampleSentences&)' does not match 'bool (Vocabulary::*)(const ExampleSentences&, const ExampleSentences&)' c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h: In function 'const _Tp& std::__median(const _Tp&, const _Tp&, const _Tp&, _Compare) [with _Tp = ExampleSentences, _Compare = bool (Vocabulary::*)(const ExampleSentences&, const ExampleSentences&)]': In file included from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/algorithm:62, from Vocabulary.cpp:12: c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:2301: instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<ExampleSentences*, std::vector<ExampleSentences, std::allocator<ExampleSentences> > >, _Size = int, _Compare = bool (Vocabulary::*)(const ExampleSentences&, const ExampleSentences&)]' c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:5258: instantiated from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<ExampleSentences*, std::vector<ExampleSentences, std::allocator<ExampleSentences> > >, _Compare = bool (Vocabulary::*)(const ExampleSentences&, const ExampleSentences&)]' Vocabulary.cpp:78: instantiated from here c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:124: error: must use '.*' or '->*' to call pointer-to-member function in '__comp (...)', e.g. '(... ->* __comp) (...)' c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:125: error: must use '.*' or '->*' to call pointer-to-member function in '__comp (...)', e.g. '(... ->* __comp) (...)' and a lot more similar stuff |
Vocabulary.cpp: In member function 'bool Vocabulary::sentenceIsLonger(const ExampleSentences&, const ExampleSentences&)': Vocabulary.cpp:68: error: passing 'const ExampleSentences' as 'this' argument of 'std::string ExampleSentences::getSimpHanzi()' discards qualifiers Vocabulary.cpp:69: error: passing 'const ExampleSentences' as 'this' argument of 'std::string ExampleSentences::getSimpHanzi()' discards qualifiers |
getSimpHanzi
|
|
Vocabulary.cpp: In member function 'void Vocabulary::sortSentences()': Vocabulary.cpp:78: error: argument of type 'bool (Vocabulary::)(ExampleSentences&, ExampleSentences&)' does not match 'bool (Vocabulary::*)(ExampleSentences&, ExampleSentences&)' c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h: In function 'const _Tp& std::__median(const _Tp&, const _Tp&, const _Tp&, _Compare) [with _Tp = ExampleSentences, _Compare = bool (Vocabulary::*)(ExampleSentences&, ExampleSentences&)]': and so on. |
(Vocabulary::)(ExampleSentences&, ExampleSentences&)' does not match 'bool (Vocabulary::*) |
(Vocabulary::) vs (Vocabulary::*) |
static bool sentenceIsLonger(const ExampleSentences &firstSentence,const ExampleSentences );
|
|
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/mkspecs/default' -o debug/Vocabulary.o Vocabulary.cpp Vocabulary.cpp:67: error: cannot declare member function 'static bool Vocabulary::sentenceIsLonger(ExampleSentences&, ExampleSentences&)' to have static linkage c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h: In function 'const _Tp& std::__median(const _Tp&, const _Tp&, const _Tp&, _Compare) [with _Tp = ExampleSentences, _Compare = bool (*)(ExampleSentences&, ExampleSentences&)]': In file included from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/algorithm:62, from Vocabulary.cpp:12: c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:2301: instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<ExampleSentences*, std::vector<ExampleSentences, std::allocator<ExampleSentences> > >, _Size = int, _Compare = bool (*)(ExampleSentences&, ExampleSentences&)]' c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:5258: instantiated from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<ExampleSentences*, std::vector<ExampleSentences, std::allocator<ExampleSentences> > >, _Compare = bool (*)(ExampleSentences&, ExampleSentences&)]' Vocabulary.cpp:78: instantiated from here c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:124: error: invalid initialization of reference of type 'ExampleSentences&' from expression of type 'const ExampleSentences' c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:125: error: invalid initialization of reference of type 'ExampleSentences&' from expression of type 'const ExampleSentences' |
++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.1/mingw/mkspecs/default' -o debug/Vocabulary.o Vocabulary.cpp c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h: In function 'const _Tp& std::__median(const _Tp&, const _Tp&, const _Tp&, _Compare) [with _Tp = ExampleSentences, _Compare = bool (*)(ExampleSentences&, ExampleSentences&)]': In file included from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/algorithm:62, from Vocabulary.cpp:12: c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:2301: instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<ExampleSentences*, std::vector<ExampleSentences, std::allocator<ExampleSentences> > >, _Size = int, _Compare = bool (*)(ExampleSentences&, ExampleSentences&)]' c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:5258: instantiated from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<ExampleSentences*, std::vector<ExampleSentences, std::allocator<ExampleSentences> > >, _Compare = bool (*)(ExampleSentences&, ExampleSentences&)]' Vocabulary.cpp:78: instantiated from here c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:124: error: invalid initialization of reference of type 'ExampleSentences&' from expression of type 'const ExampleSentences' c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/stl_algo.h:125: error: invalid initialization of reference of type 'ExampleSentences&' from expression of type 'const ExampleSentences' |
When used in the declaration of a class member, the static specifier shall only be used in the member declarations that appear within the member-specification of the class definition. [ Note: It cannot be specified in member declarations that appear in namespace scope. —end note ] |
std::string getSimpHanzi() const;
|
|
|
|