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

problem with c++ header files #51

Open
alirezahdd opened this issue Dec 27, 2018 · 2 comments
Open

problem with c++ header files #51

alirezahdd opened this issue Dec 27, 2018 · 2 comments

Comments

@alirezahdd
Copy link

alirezahdd commented Dec 27, 2018

Hello
I just installed Accept on my ubuntu 18.04 system. Installation was fine without any errors.
I have a problem with the header files. when I want to compile a c++ code, I get too many errors because of my "include <vector.h>" and the log is:


In file included from test_cxx.cpp:4:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/vector:59:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_algobase.h:66:
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator_base_funcs.h:77:12: error: unknown type name '_GLIBCXX14_CONSTEXPR'
inline _GLIBCXX14_CONSTEXPR
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator_base_funcs.h:78:5: error: expected unqualified-id
typename iterator_traits<_InputIterator>::difference_type
^
In file included from test_cxx.cpp:4:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/vector:59:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_algobase.h:67:
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:125:7: error: unknown type name '_GLIBCXX17_CONSTEXPR'
_GLIBCXX17_CONSTEXPR
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:126:7: error: member 'reverse_iterator' has the same name as its class
reverse_iterator() : current() { }
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:126:7: error: constructor cannot have a return type
reverse_iterator() : current() { }
^~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:131:16: error: unknown type name '_GLIBCXX17_CONSTEXPR'
explicit _GLIBCXX17_CONSTEXPR
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:132:7: error: member 'reverse_iterator' has the same name as its class
reverse_iterator(iterator_type __x) : current(__x) { }
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:132:7: error: constructor cannot have a return type
reverse_iterator(iterator_type __x) : current(__x) { }
^~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:137:7: error: unknown type name '_GLIBCXX17_CONSTEXPR'
_GLIBCXX17_CONSTEXPR
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:138:7: error: member 'reverse_iterator' has the same name as its class
reverse_iterator(const reverse_iterator& __x)
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:138:7: error: constructor cannot have a return type
reverse_iterator(const reverse_iterator& __x)
^~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:146:2: error: unknown type name '_GLIBCXX17_CONSTEXPR'
_GLIBCXX17_CONSTEXPR
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:147:9: error: member 'reverse_iterator' has the same name as its class
reverse_iterator(const reverse_iterator<_Iter>& __x)
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:147:9: error: constructor cannot have a return type
reverse_iterator(const reverse_iterator<_Iter>& __x)
^~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:153:7: error: unknown type name '_GLIBCXX17_CONSTEXPR'
_GLIBCXX17_CONSTEXPR iterator_type
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:153:28: error: duplicate member 'iterator_type'
_GLIBCXX17_CONSTEXPR iterator_type
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:114:29: note: previous declaration is here
typedef _Iterator iterator_type;
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:153:41: error: expected ';' at end of declaration list
_GLIBCXX17_CONSTEXPR iterator_type
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:298:12: error: unknown type name '_GLIBCXX17_CONSTEXPR'
inline _GLIBCXX17_CONSTEXPR bool
^
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_iterator.h:298:33: error: expected unqualified-id
inline _GLIBCXX17_CONSTEXPR bool
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
consumer finished
20 errors generated.
/home/alireza/accept/accept.mk:114: recipe for target 'test_cxx.bc' failed
make: *** [test_cxx.bc] Error 1


I think this is because of using 7.3.0 c++ headers. Can we just change it to 4.8 c++ headers ? or is there any idea how to solve this problem?

any help will be appreciated

@sampsyo
Copy link
Member

sampsyo commented Dec 27, 2018

In the future, you'll want to use GitHub's Markdown code delimiters for pastes like this. (Without those, it's not really readable.)

I don't really have any advice about how to solve this—you'll want to fiddle with your include paths a bunch to see what makes it work. Good luck!

@lucasreis1
Copy link
Contributor

#56

I've proposed a pull request that should solve this issue.

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

3 participants