Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue: Invalid use of incomplete type #39

Open
mechgt opened this issue Dec 26, 2022 · 1 comment
Open

Build issue: Invalid use of incomplete type #39

mechgt opened this issue Dec 26, 2022 · 1 comment

Comments

@mechgt
Copy link

mechgt commented Dec 26, 2022

I'm getting an error when trying to build (see below). This same error (invalid use of incomplete type) is repeated across many files. Any idea?

┌──(kali㉿kali)-[~/ropium]
└─$ make 
g++ -O2 -Wno-narrowing `python3-config --cflags` -DPYTHON_BINDINGS -Ibindings/python -std=c++11 -fpermissive -fPIC -I ./libropium/include -I ./libropium/dependencies/murmur3 -Wno-write-strings -Wno-sign-compare -Wno-reorder  -c libropium/database/database.cpp -o libropium/database/database.o -lcapstone `python3-config --libs`
In file included from libropium/database/database.cpp:1:

./libropium/include/database.hpp: In instantiation of ‘bool BaseDB<K>::_check_key_match(const K&, const K&, bool*, int) [with K = std::tuple<short unsigned int, short unsigned int>]’:
./libropium/include/database.hpp:109:39:   required from ‘PossibleGadgets* BaseDB<K>::get_possible(K, bool*, int) [with K = std::tuple<short unsigned int, short unsigned int>]’
libropium/database/database.cpp:316:32:   required from here
./libropium/include/database.hpp:95:33: error: invalid use of incomplete type ‘struct std::array<long int, 2>’
   95 |         auto a1 = tuple_to_array(key1);
      |                   ~~~~~~~~~~~~~~^~~~~~
In file included from ./libropium/include/database.hpp:5:
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<long int, 2>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
./libropium/include/database.hpp:96:33: error: invalid use of incomplete type ‘struct std::array<long int, 2>’
   96 |         auto a2 = tuple_to_array(key2);
      |                   ~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<long int, 2>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
In file included from ./libropium/include/database.hpp:7:
./libropium/include/utils.hpp: In instantiation of ‘std::vector<long int> tuple_to_vector(Tuple&&) [with Tuple = const std::tuple<short unsigned int, short unsigned int>&]’:
./libropium/include/database.hpp:110:52:   required from ‘PossibleGadgets* BaseDB<K>::get_possible(K, bool*, int) [with K = std::tuple<short unsigned int, short unsigned int>]’
libropium/database/database.cpp:316:32:   required from here
./libropium/include/utils.hpp:127:32: error: invalid use of incomplete type ‘struct std::array<long int, 2>’
  127 |     auto array = tuple_to_array(tuple);
      |                  ~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<long int, 2>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
./libropium/include/database.hpp: In instantiation of ‘bool BaseDB<K>::_check_key_match(const K&, const K&, bool*, int) [with K = std::tuple<short unsigned int, short unsigned int, int, short unsigned int>]’:
./libropium/include/database.hpp:109:39:   required from ‘PossibleGadgets* BaseDB<K>::get_possible(K, bool*, int) [with K = std::tuple<short unsigned int, short unsigned int, int, short unsigned int>]’
libropium/database/database.cpp:320:33:   required from here
./libropium/include/database.hpp:95:33: error: invalid use of incomplete type ‘struct std::array<long int, 4>’
   95 |         auto a1 = tuple_to_array(key1);
      |                   ~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<long int, 4>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
./libropium/include/database.hpp:96:33: error: invalid use of incomplete type ‘struct std::array<long int, 4>’
   96 |         auto a2 = tuple_to_array(key2);
      |                   ~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<long int, 4>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
./libropium/include/utils.hpp: In instantiation of ‘std::vector<long int> tuple_to_vector(Tuple&&) [with Tuple = const std::tuple<short unsigned int, short unsigned int, int, short unsigned int>&]’:
./libropium/include/database.hpp:110:52:   required from ‘PossibleGadgets* BaseDB<K>::get_possible(K, bool*, int) [with K = std::tuple<short unsigned int, short unsigned int, int, short unsigned int>]’
libropium/database/database.cpp:320:33:   required from here
./libropium/include/utils.hpp:127:32: error: invalid use of incomplete type ‘struct std::array<long int, 4>’
  127 |     auto array = tuple_to_array(tuple);
      |                  ~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<long int, 4>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
./libropium/include/database.hpp: In instantiation of ‘bool BaseDB<K>::_check_key_match(const K&, const K&, bool*, int) [with K = std::tuple<short unsigned int, long int>]’:
./libropium/include/database.hpp:109:39:   required from ‘PossibleGadgets* BaseDB<K>::get_possible(K, bool*, int) [with K = std::tuple<short unsigned int, long int>]’
libropium/database/database.cpp:324:32:   required from here
./libropium/include/database.hpp:95:33: error: invalid use of incomplete type ‘struct std::array<long int, 2>’
   95 |         auto a1 = tuple_to_array(key1);
      |                   ~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘struct std::array<long int, 2>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
...
make: *** [Makefile:83: libropium/database/database.o] Error 1
@mechgt
Copy link
Author

mechgt commented Jan 10, 2023

Adding #include <array> to the database.hpp file seems to have fixed this for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant