Details
Description
I'm looking at CCBC-1441, which requires me to edit some example code (and possibly create new example for analytics, as that doesn't have an existing one)
❯ git grep 'lcb_cmd.*_positional_param' |
|
modules/devguide/examples/c/query-atplus.cc: check(lcb_cmdquery_positional_param(cmd, param.c_str(), param.size()), "add positional parameter for QUERY command"); |
modules/devguide/examples/c/query-consistency.cc: check(lcb_cmdquery_positional_param(cmd, param.c_str(), param.size()), "add positional parameter for QUERY command"); |
modules/devguide/examples/c/query-placeholders.cc: check(lcb_cmdquery_positional_param(cmd, city_json.c_str(), city_json.size()), "add positional parameter for QUERY comand"); |
modules/howtos/pages/analytics-using-sdk.adoc:| `lcb_cmdanalytics_positional_param(command, argument value, argument length)` | Adds a positional argument for the analytics query. |
modules/howtos/pages/n1ql-queries-with-sdk.adoc:| `lcb_cmdquery_positional_param(command, argument value, argument length)` | Adds a positional argument for the query. |
The instructions in modules/devguide/examples/c say
On POSIX systems you can simply run make and the examples will be built
(assuming you have the library itself installed).
But make doesn't work. It looks like the only target that does work is `durability` (and that's not one of the ones I need to work on.
e.g. (I've compressed similar errors for brevity)
❯ make
|
c++ -Wall -g bulk-get.cc -lcouchbase -pthread -o bulk-get
|
bulk-get.cc:18:17: error: function definition does not declare parameters |
std::string key{};
|
^
|
... ^
|
bulk-get.cc:28:9: error: use of undeclared identifier 'key' |
key.assign(buf, buf_len);
|
^
|
...
|
bulk-get.cc:44:14: error: no member named 'emplace_back' in 'std::__1::vector<Result>' |
results->emplace_back(resp);
|
~~~~~~~ ^
|
bulk-get.cc:50:25: error: expected ';' at end of declaration |
std::string username{ "Administrator" }; |
... ;
|
bulk-get.cc:79:16: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] |
for (const auto& key : keys_to_get) { |
^
|
bulk-get.cc:79:26: warning: range-based for loop is a C++11 extension [-Wc++11-extensions] |
for (const auto& key : keys_to_get) { |
...
|
~~~~~~ ^
|
4 warnings and 15 errors generated. |
make: *** [bulk-get] Error 1 |
I tried removing bulk-get.cc and subsequent targets from the Makefile, and only `durability` endured...
Would be great to get this resolved - would let us work on CCBC-1441 (and other lcb examples!) autonomously. If we can't build and run the examples, then would really do with your team's help for working snippets