I am getting below error,
Focus//build/libfocus.a(FocusParser.o): In function FocusParser::parse(std::string const&)':
/builddir/project/src/Focus/FocusParser.cpp:22: undefined reference to
yyFC_scan_bytes(char const*, int)'
The code is as follow. As seen in the code the function is already defined on line 12. Please help.
1 #include <stdio.h>
2 #include <errno.h>
3 #include <string.h>
4
5 #include "Exception.h"
6 #include "Builder.h"
7
8 #include "FocusParser.h"
9 #include "FocusState.h"
10
11 int yyFCparse();
12 int yyFC_scan_bytes(const char *bytes, int len);
13
14 FocusStatePtr FocusParser::parse(const string &query)
15 {
16 // mutex lock for focus
17 boost::mutex::scoped_lock lock(gFocusStateMutex);
18
19 // setup parse context
20 gFocusState = FocusStatePtr(new FocusState());
21
22 yyFC_scan_bytes(query.data(), query.length());
23
24 yyFCparse();
25
26 // reset global state info
27 FocusStatePtr result = gFocusState;
28 gFocusState.reset();
29
30 return result;
31 }