Errors when compiling with g++
Created by: suneelkv
Hi,
I thought of using more than one filter and hence tried this in my program.
cangjie_new(&m_ptrCangjie, CANGJIE_VERSION_5,(CANGJIE_FILTER_CHINESE | CANGJIE_FILTER_HKSCS));
As per the documentation it is mentioned that to get all the characters set should use bit flags OR and use more than one filter. http://cangjians.github.io/projects/libcangjie/documentation/filters.html
Have tried with the code above and got a compilation error as below
source/TranslateManager.cpp:179:103: error: invalid conversion from ‘int’ to ‘CangjieFilter’
source/TranslateManager.cpp:179:103: error: initializing argument 3 of ‘int cangjie_new(Cangjie**, CangjieVersion, CangjieFilter)’
I've done a type cast for the code as below to overcome the compilation error
cangjie_new(&m_ptrCangjie, CANGJIE_VERSION_5,(CangjieFilter)CANGJIE_FILTER_CHINESE | CANGJIE_FILTER_HKSCS );
It compiled succesffully,but unfortunately I couldn't see any difference in the character set I get from the cangjie library. Is it the casting I'm doing wrong or is it the libcangjie which couldn't OR the filters properly in the code.
Please let me know.