PDB-REDO / libcifpp

Library containing code to manipulate mmCIF and PDB files
https://pdb-redo.github.io/libcifpp/
BSD 2-Clause "Simplified" License
28 stars 10 forks source link

Build fails: no member named 'stack' in namespace 'std' #22

Closed yurivict closed 1 year ago

yurivict commented 1 year ago
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/category.cpp:563:7: error: no member named 'stack' in namespace 'std'
        std::stack<entry *> s;
        ~~~~~^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/category.cpp:563:13: error: 'entry' does not refer to a value
        std::stack<entry *> s;
                   ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/category.cpp:185:9: note: declared here
        struct entry
               ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/category.cpp:563:20: error: expected expression
        std::stack<entry *> s;
                          ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/category.cpp:563:22: error: use of undeclared identifier 's'
        std::stack<entry *> s;
                            ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/category.cpp:564:2: error: use of undeclared identifier 's'
        s.push(m_root);
        ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/category.cpp:568:13: error: use of undeclared identifier 's'
        while (not s.empty())
                   ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/category.cpp:570:14: error: use of undeclared identifier 's'
                entry *e = s.top();
                           ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/model.cpp:1964:8: error: no member named 'stack' in namespace 'std'
                std::stack<size_t> test;
                ~~~~~^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/model.cpp:1964:14: error: unexpected type name 'size_t': expected expression
                std::stack<size_t> test;
                           ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/model.cpp:1964:22: error: use of undeclared identifier 'test'; did you mean 'tzset'?
                std::stack<size_t> test;
                                   ^~~~
                                   tzset
/usr/include/time.h:143:6: note: 'tzset' declared here
void tzset(void);
     ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/model.cpp:1965:3: error: use of undeclared identifier 'test'
                test.push(s.num());
                ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/model.cpp:1967:14: error: use of undeclared identifier 'test'
                while (not test.empty())
                           ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/model.cpp:1969:15: error: use of undeclared identifier 'test'
                        auto tix = test.top();
                                   ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/model.cpp:1970:4: error: use of undeclared identifier 'test'
                        test.pop();
                        ^
/disk-samsung/freebsd-ports/science/libcifpp/work/libcifpp-5.0.2/src/model.cpp:1980:6: error: use of undeclared identifier 'test'
                                        test.push(s.num());
                                        ^
8 errors generated.

clang-14 FreeBSD 13.1

mhekkel commented 1 year ago

Just tested the trunk version with:

[maarten@bsd12 ~]$ uname -a FreeBSD bsd12 12.3-RELEASE-p6 FreeBSD 12.3-RELEASE-p6 GENERIC amd64 [maarten@bsd12 ~]$ clang++14 --version clang version 14.0.6 Target: x86_64-portbld-freebsd12.3 Thread model: posix InstalledDir: /usr/local/llvm14/bin

Seems to work OK?

I must admit I fixed that recently. Perhaps you picked up an older version?

yurivict commented 1 year ago

#include <stack> is missing in these modules. Did you add it?

mhekkel commented 1 year ago

https://github.com/PDB-REDO/libcifpp/blob/2d4a1731d9f380ba2b61a8e6ce948f01233fd037/src/category.cpp#L28

Yes, I did. What code are you looking at?

yurivict commented 1 year ago

Ok.

I was looking at 5.0.2

I guess the fix will come into the next release.

Thanks!