找不到C ++源代码中使用变量的位置

时间:2015-10-05 12:24:53

标签: c++

我从C ++开始,我正在研究我将要使用的HElib库的源代码。

在文件Test_General.cpp中有一个变量3 warnings generated. CC(target) Release/obj.target/libxml/vendor/libxml/xpointer.o LIBTOOL-STATIC Release/xml.a CXX(target) Release/obj.target/xmljs/src/libxmljs.o In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:11:34: error: expected class name class XmlDocument : public node::ObjectWrap { ^ ../src/xml_document.h:42:44: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> New(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:43:49: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> FromHtml(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:44:48: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> FromXml(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:45:47: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> SetDtd(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:48:45: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Root(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:49:49: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Encoding(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:50:48: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Version(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:51:44: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Doc(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:52:47: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Errors(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:53:49: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> ToString(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:54:49: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Validate(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:8: ../src/xml_document.h:30:9: error: use of undeclared identifier 'Ref'; did you mean 'ref'? Ref(); ^~~ ref ../src/xml_document.h:29:10: note: 'ref' declared here void ref() { ^ ../src/xml_document.h:34:9: error: use of undeclared identifier 'Unref'; did you mean 'unref'? Unref(); ^~~~~ unref ../src/xml_document.h:33:10: note: 'unref' declared here void unref() { ^ In file included from ../src/libxmljs.cc:9: ../src/xml_node.h:9:30: error: expected class name class XmlNode : public node::ObjectWrap { ^ ../src/xml_node.h:25:44: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Doc(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:9: ../src/xml_node.h:26:50: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Namespace(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:9: ../src/xml_node.h:27:51: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Namespaces(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/libxmljs.cc:9: ../src/xml_node.h:28:47: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? static v8::Handle<v8::Value> Parent(const v8::Arguments& args); ^~~~~~~~~~~~~ v8::internal::Arguments /Users/awaghma/.node-gyp/0.12.5/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; &#34;安全参数&#34; ,根据第303行)。

问题:此文件中是否未使用此变体?

函数gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12) gyp ERR! System Darwin 14.5.0 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/awaghma/smartphone_web/node_modules/excel/node_modules/libxmljs gyp ERR! node -v v0.12.5 gyp ERR! node-gyp -v v2.0.1 gyp ERR! not ok npm ERR! Darwin 14.5.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "excel" npm ERR! node v0.12.5 npm ERR! npm v2.11.2 npm ERR! code ELIFECYCLE npm ERR! libxmljs@0.8.1 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the libxmljs@0.8.1 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the libxmljs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls libxmljs npm ERR! There is likely additional logging output above. 第57行以k为参数,但我看不到它使用它的任何行。 根据我对该方案的了解,应该在设置阶段使用它,通常是在void TestIt第79行或之后不久建立时。

此变量是否可能在此函数中使用,而在此文件中不明显?

3 个答案:

答案 0 :(得分:1)

似乎在这里使用:

TestIt(R, p, r, d, c, k, w, L, m, gens, ords);

答案 1 :(得分:0)

std::cerr中使用它来形成错误消息。

没有强制程序员用变量做某事的规则,也许它只是一个标记,指出错误信息中有用的东西。

也可能是一些向后兼容性。因此,函数可以与旧代码一起使用,该代码传递11个参数并与新版本兼容,严格指定仅10个(但仍然传递11个。)

并且有一个与潜在的未来问题相关的事情,因此k可能是保留变量,并且可能在将来变得有意义(所以现在你可以传递任何东西)。

很难说因为可能有很多不同的原因,如果你想要真正正确的答案,你应该联系那些编写该代码的人。

答案 2 :(得分:0)

我的不好,它在第349行用于计算m

long m = FindM(k, L, c, p, d, s, chosen_m, true);

然后m用于在第79行构建上下文:

FHEcontext context(m, p, r, gens1, ords1);

所以现在一切都很好。对不起烦恼。