Error while building postprocess.cpp
albanmdb3d opened this issue · 1 comments
albanmdb3d commented
Hello,
Thank you for the code and congratulations for the acceptance. I am trying to run your demo code. However, I have issues when building postprocess.cpp. Here is the log infos:
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:18:48: error: wrong number of template arguments (4, should be 5)
AnnoyIndex<int, double, Euclidean, Kiss32Random> pc_knn = AnnoyIndex<int, double, Euclidean, Kiss32Random>(3);
^
In file included from /home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:3:0:
/home/alban/Documents/Point2Mesh/postprocess/../annoy/src/annoylib.h:841:9: note: provided for ‘template<class S, class T, class Distance, class Random, class ThreadedBuildPolicy> class AnnoyIndex’
class AnnoyIndex : public AnnoyIndexInterface<S, T> {
^~~~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:18:106: error: wrong number of template arguments (4, should be 5)
AnnoyIndex<int, double, Euclidean, Kiss32Random> pc_knn = AnnoyIndex<int, double, Euclidean, Kiss32Random>(3);
^
In file included from /home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:3:0:
/home/alban/Documents/Point2Mesh/postprocess/../annoy/src/annoylib.h:841:9: note: provided for ‘template<class S, class T, class Distance, class Random, class ThreadedBuildPolicy> class AnnoyIndex’
class AnnoyIndex : public AnnoyIndexInterface<S, T> {
^~~~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp: In function ‘int main(int, char**)’:
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:205:12: error: request for member ‘add_item’ in ‘pc_knn’, which is of non-class type ‘int’
pc_knn.add_item(i, vec);
^~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:207:10: error: request for member ‘build’ in ‘pc_knn’, which is of non-class type ‘int’
pc_knn.build(10);
^~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:211:12: error: request for member ‘get_nns_by_item’ in ‘pc_knn’, which is of non-class type ‘int’
pc_knn.get_nns_by_item(i, K + 1, -1, &knn_id[i], &knn_dis[i]);
^~~~~~~~~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:199:10: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen(input_file.c_str(), "r", stdin);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:200:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n_pc);
~~~~~^~~~~~~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:203:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf%lf%lf", &vec[0], &vec[1], &vec[2]);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:227:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n_candidates);
~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:230:12: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d %d", &a, &b, &c, &label);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/alban/Documents/Point2Mesh/postprocess/postprocess.cpp:278:10: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen(output_file.c_str(), "w", stdout);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMakeFiles/postprocess.dir/build.make:62: recipe for target 'CMakeFiles/postprocess.dir/postprocess.cpp.o' failed
make[2]: *** [CMakeFiles/postprocess.dir/postprocess.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/postprocess.dir/all' failed
make[1]: *** [CMakeFiles/postprocess.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Any idea what might be causing this?
Thanks!
Colin97 commented
Hi, annoy recently changed their API. Could you please download the previous version (1.16)? Thanks.