Skip to content

Failed to compile phtree.h #10

Description

@aurelw

I try to create a minimal example and included phtree.h:

#include <iostream>

#include "phtree/phtree.h"

int main() {
    std::cout << "foo" << std::endl;
}

However, I get the following compile errors.... just the first lines of the compiler output:

[ 90%] Building CXX object src/test/CMakeFiles/test_phtree.dir/test_phtree.cpp.o
In file included from /home/user/devel/example/phtree-cpp/phtree/v16/node.h:20,
                 from /home/user/devel/example/phtree-cpp/phtree/v16/debug_helper_v16.h:20,
                 from /home/user/devel/example/phtree-cpp/phtree/v16/phtree_v16.h:20,
                 from /home/user/devel/example/phtree-cpp/phtree/phtree.h:21,
                 from /home/user/devel/example/phtree_test/src/test/test_phtree.cpp:7:
/home/user/devel/example/phtree-cpp/phtree/v16/entry.h:44:11: error: declaration of ‘using Node = class improbable::phtree::v16::Node<DIM, T, SCALAR>’ changes meaning of ‘Node’ [-fpermissive]
   44 |     using Node = Node<DIM, T, SCALAR>;
      |           ^~~~
/home/user/devel/example/phtree-cpp/phtree/v16/entry.h:31:7: note: ‘Node’ declared here as ‘class improbable::phtree::v16::Node<DIM, T, SCALAR>’
   31 | class Node;
      |       ^~~~
In file included from /home/user/devel/example/phtree-cpp/phtree/v16/debug_helper_v16.h:20,
                 from /home/user/devel/example/phtree-cpp/phtree/v16/phtree_v16.h:20,
                 from /home/user/devel/example/phtree-cpp/phtree/phtree.h:21,
                 from /home/user/devel/example/phtree_test/src/test/test_phtree.cpp:7:
/home/user/devel/example/phtree-cpp/phtree/v16/node.h:112:11: error: declaration of ‘using Entry = class improbable::phtree::v16::Entry<DIM, T, SCALAR>’ changes meaning of ‘Entry’ [-fpermissiv ]
  112 |     using Entry = Entry<DIM, T, SCALAR>;
      |           ^~~~~
In file included from /home/user/devel/example/phtree-cpp/phtree/v16/node.h:20,
                 from /home/user/devel/example/phtree-cpp/phtree/v16/debug_helper_v16.h:20,
                 from /home/user/devel/example/phtree-cpp/phtree/v16/phtree_v16.h:20,
                 from /home/user/devel/example/phtree-cpp/phtree/phtree.h:21,
                 from /home/user/devel/example/phtree_test/src/test/test_phtree.cpp:7:
/home/user/devel/example/phtree-cpp/phtree/v16/entry.h:41:7: note: ‘Entry’ declared here as ‘class improbable::phtree::v16::Entry<DIM, T, SCALAR>’

..... and so on.

I compile with gcc and CMAKE_CXX_STANDARD 17. When I compile the library with Example, everything works fine though. What am I missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions