Closed davephillips closed 6 years ago
Hmmm. Those members (begin
and end
) should be defined in the base class (Rack's Textfield)....
It seems like the class has changed. I will have to re-work it later.
For now, you could try to just define them in the struct (TSTextField.hpp):
struct TSTextField : TextField {
int begin = 0; // ADD THIS MEMBER
int end = 0; // ADD THIS MEMBER
// Maximum length allowed.
uint16_t maxLength = 50;
Hey, you officially rock ! Thanks for the news and the fix, I have your modules built and running in the latest Rack master. Best regards !
Thank you for pointing that out. I'm glad that's all it needed :-).
Fedora 23 Linux Rack master (0.6.x)
Build fails with this error:
g++ -Wsuggest-override -std=c++11 -fPIC -I../../include -I../../dep/include -DSLUG=trowaSoft -DVERSION=0.6.5.2dev -MMD -g -O3 -march=nocona -ffast-math -fno-finite-math-only -Wall -Wextra -Wno-unused-parameter -DARCH_LIN -c -o build/src/TSTextField.cpp.o src/TSTextField.cpp src/TSTextField.cpp: In member function ‘void TSTextField::insertText(std::cxx11::string)’: src/TSTextField.cpp:50:6: error: ‘begin’ was not declared in this scope if (begin < end) ^ src/TSTextField.cpp:50:6: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:87:5: note: ‘std::begin’ begin(_Tp (&arr)[_Nm]) ^ src/TSTextField.cpp:50:14: error: ‘end’ was not declared in this scope if (begin < end) ^ src/TSTextField.cpp:50:14: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:97:5: note: ‘std::end’ end(_Tp (&arr)[_Nm]) ^ src/TSTextField.cpp:53:14: error: ‘begin’ was not declared in this scope text.insert(begin, cleansedStr); ^ src/TSTextField.cpp:53:14: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:87:5: note: ‘std::begin’ begin(_Tp (&__arr)[_Nm]) ^ src/TSTextField.cpp:59:2: error: ‘end’ was not declared in this scope end = begin; ^ src/TSTextField.cpp:59:2: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:97:5: note: ‘std::end’ end(_Tp (&arr)[_Nm]) ^ src/TSTextField.cpp: In member function ‘virtual void TSTextField::onTextChange()’: src/TSTextField.cpp:65:2: error: ‘begin’ was not declared in this scope begin = min(max(begin, 0), text.size()); ^ src/TSTextField.cpp:65:2: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:87:5: note: ‘std::begin’ begin(_Tp (&arr)[_Nm]) ^ src/TSTextField.cpp:66:2: error: ‘end’ was not declared in this scope end = min(max(end, 0), text.size()); ^ src/TSTextField.cpp:66:2: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:97:5: note: ‘std::end’ end(_Tp (&__arr)[_Nm]) ^ src/TSTextField.cpp: In member function ‘virtual void TSTextField::onKey(rack::EventKey&)’: src/TSTextField.cpp:81:7: error: ‘begin’ was not declared in this scope if (begin < end) { ^ src/TSTextField.cpp:81:7: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:87:5: note: ‘std::begin’ begin(_Tp (&arr)[_Nm]) ^ src/TSTextField.cpp:81:15: error: ‘end’ was not declared in this scope if (begin < end) { ^ src/TSTextField.cpp:81:15: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:97:5: note: ‘std::end’ end(_Tp (&arr)[_Nm]) ^ src/TSTextField.cpp:92:3: error: ‘end’ was not declared in this scope end = begin; ^ src/TSTextField.cpp:92:3: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:97:5: note: ‘std::end’ end(_Tp (&__arr)[_Nm]) ^ src/TSTextField.cpp:92:9: error: ‘begin’ was not declared in this scope end = begin; ^ src/TSTextField.cpp:92:9: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:87:5: note: ‘std::begin’ begin(_Tp (&arr)[_Nm]) ^ src/TSTextField.cpp:181:3: error: ‘begin’ was not declared in this scope begin = min(max(begin, 0), text.size()); ^ src/TSTextField.cpp:181:3: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:87:5: note: ‘std::begin’ begin(_Tp (&__arr)[_Nm]) ^ src/TSTextField.cpp:182:3: error: ‘end’ was not declared in this scope end = min(max(end, 0), text.size()); ^ src/TSTextField.cpp:182:3: note: suggested alternative: In file included from /usr/include/c++/5.3.1/string:51:0, from ../../include/util/common.hpp:10, from ../../include/rack.hpp:4, from src/TSTextField.hpp:4, from src/TSTextField.cpp:1: /usr/include/c++/5.3.1/bits/range_access.h:97:5: note: ‘std::end’ end(_Tp (&__arr)[_Nm]) ^ ../../compile.mk:59: recipe for target 'build/src/TSTextField.cpp.o' failed make: *** [build/src/TSTextField.cpp.o] Error 1
Any suggestions for a fix ?