BwTree icon indicating copy to clipboard operation
BwTree copied to clipboard

Compilation Issues

Open MayankSur opened this issue 5 years ago • 1 comments

Hi,

I've been having an issue compiling the current files and I've just made a few changes to try and remove the thread information since I wanted to reformat that. However, the issue I keep getting into is the error below:

In instantiation of ‘std::tuple<long unsigned int, long unsigned int> BwTree::Tree<Key, Data>::getConsolidatedLeafData(BwTree::Node<Key, Data>, std::vector<BwTree::KeyValue<Key, Data> >&) [with Key = unsigned int; Data = unsigned int]’: /home/mayank/Documents/BW-Trees/src/bwtree.cpp:1126:24: required from here /home/mayank/Documents/BW-Trees/src/bwtree.cpp:892:67: error: cannot convert ‘BwTree::KeyValue<unsigned int, unsigned int>’ to ‘std::array<unsigned int, 100>::value_type {aka unsigned int}’ in assignment deltaInsertRecords[deltaInsertRecordsCount++] = node1->record; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ /home/mayank/Documents/BW-Trees/src/bwtree.cpp:935:43: error: invalid const_cast from type ‘std::array<unsigned int, 100>::pointer {aka unsigned int}’ to type ‘BwTree::KeyValue<unsigned int, unsigned int>*’ KeyValue<Key, Data> *recordsdata[] = {const_cast<KeyValue<Key, Data> *>(deltaInsertRecords.data()), node1->records};

There seems to be an error with regards to the array and I'm wondering how you got around this, it might just be due to my lack of understanding, would be grateful if you could help.

I'm using c++14, and have imported the array container library as well.

MayankSur avatar May 10 '20 12:05 MayankSur

I managed to change the types correctly, but am still running into this error:

In instantiation of ‘std::tuple<long unsigned int, long unsigned int> BwTree::Tree<Key, Data>::getConsolidatedLeafData(BwTree::Node<Key, Data>, std::vector<BwTree::KeyValue<Key, Data> >&) [with Key = unsigned int; Data = unsigned int]’: /home/mayank/Documents/BW-Trees/src/bwtree.cpp:1126:24: required from here /home/mayank/Documents/BW-Trees/src/bwtree.cpp:874:42: error: use of deleted function ‘std::array<BwTree::KeyValue<unsigned int, unsigned int>, 100>::array()’ std::array<KeyValue<Key, Data>, 100> deltaInsertRecords; ^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/7/tuple:39:0, from /usr/include/c++/7/unordered_map:41, from /home/mayank/Documents/BW-Trees/src/bwtree.cpp:1: /usr/include/c++/7/array:94:12: note: ‘std::array<BwTree::KeyValue<unsigned int, unsigned int>, 100>::array()’ is implicitly deleted because the default definition would be ill-formed: struct array ^~~~~ /usr/include/c++/7/array:94:12: error: no matching function for call to ‘BwTree::KeyValue<unsigned int, unsigned int>::KeyValue()’ In file included from /home/mayank/Documents/BW-Trees/src/bwtree.cpp:9:0: /home/mayank/Documents/BW-Trees/src/nodes.hpp:52:9: note: candidate: BwTree::KeyValue<Key, Data>::KeyValue(const Key&, const Data const&) [with Key = unsigned int; Data = unsigned int] KeyValue(const Key &key, const Data const & data) : key(key), data(data) { } ^~~~~~~~ /home/mayank/Documents/BW-Trees/src/nodes.hpp:52:9: note: candidate expects 2 arguments, 0 provided /home/mayank/Documents/BW-Trees/src/nodes.hpp:48:12: note: candidate: constexpr BwTree::KeyValue<unsigned int, unsigned int>::KeyValue(const BwTree::KeyValue<unsigned int, unsigned int>&) struct KeyValue { ^~~~~~~~ /home/mayank/Documents/BW-Trees/src/nodes.hpp:48:12: note: candidate expects 1 argument, 0 provided /home/mayank/Documents/BW-Trees/src/bwtree.cpp: In instantiation of ‘std::tuple<long unsigned int, long unsigned int> BwTree::Tree<Key, Data>::getConsolidatedLeafData(BwTree::Node<Key, Data>, std::vector<BwTree::KeyValue<Key, Data> >&) [with Key = unsigned int; Data = long unsigned int]’:

MayankSur avatar May 10 '20 14:05 MayankSur