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

Lessons failed to compile due to type conflict in fatal/test/string.h #39

Closed
yinghai opened this issue Oct 14, 2016 · 0 comments
Closed

Comments

@yinghai
Copy link

yinghai commented Oct 14, 2016

When I tried to compile lessons on Mac OS X with gcc-4.9. I got the following error:

$ g++-4.9 -std=c++11 -I/Users/yinghai/Code/fatal lesson/1.0-variables.cpp -o l1
In file included from /Users/yinghai/Code/fatal/fatal/test/test.h:14:0,
                 from /Users/yinghai/Code/fatal/fatal/lesson/lesson.h:13,
                 from /Users/yinghai/Code/fatal/fatal/lesson/driver.h:13,
                 from lesson/1.0-variables.cpp:10:
/Users/yinghai/Code/fatal/fatal/test/string.h:54:10: error: redefinition of 'struct fatal::detail::string_impl::parse_impl_conversion_pair<std::basic_string<char>, long long int>'
   struct parse_impl_conversion_pair<std::string, From> { \
          ^
/Users/yinghai/Code/fatal/fatal/test/string.h:73:1: note: in expansion of macro 'FATAL_IMPL_PARSE_CONVERSION_PAIR'
 FATAL_IMPL_PARSE_CONVERSION_PAIR(long long);
 ^
/Users/yinghai/Code/fatal/fatal/test/string.h:54:10: error: previous definition of 'struct fatal::detail::string_impl::parse_impl_conversion_pair<std::basic_string<char>, long long int>'
   struct parse_impl_conversion_pair<std::string, From> { \
          ^
/Users/yinghai/Code/fatal/fatal/test/string.h:67:1: note: in expansion of macro 'FATAL_IMPL_PARSE_CONVERSION_PAIR'
 FATAL_IMPL_PARSE_CONVERSION_PAIR(std::int64_t);
 ^
/Users/yinghai/Code/fatal/fatal/test/string.h:54:10: error: redefinition of 'struct fatal::detail::string_impl::parse_impl_conversion_pair<std::basic_string<char>, long long unsigned int>'
   struct parse_impl_conversion_pair<std::string, From> { \
          ^
/Users/yinghai/Code/fatal/fatal/test/string.h:74:1: note: in expansion of macro 'FATAL_IMPL_PARSE_CONVERSION_PAIR'
 FATAL_IMPL_PARSE_CONVERSION_PAIR(unsigned long long);
 ^
/Users/yinghai/Code/fatal/fatal/test/string.h:54:10: error: previous definition of 'struct fatal::detail::string_impl::parse_impl_conversion_pair<std::basic_string<char>, long long unsigned int>'
   struct parse_impl_conversion_pair<std::string, From> { \
          ^
/Users/yinghai/Code/fatal/fatal/test/string.h:71:1: note: in expansion of macro 'FATAL_IMPL_PARSE_CONVERSION_PAIR'
 FATAL_IMPL_PARSE_CONVERSION_PAIR(std::uint64_t);
 ^

The reason for that is https://github.com/facebook/fatal/blob/master/fatal/test/string.h#L73 and https://github.com/facebook/fatal/blob/master/fatal/test/string.h#L74, type long long and unsigned long long are the same as std::int64_t and std::uint64_t. Commenting out these two lines will make things work.

@juchem juchem closed this as completed in 76f6de9 Oct 14, 2016
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