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

fail to compile on linux OS #20

Closed
wcy168 opened this issue Jul 29, 2022 · 3 comments
Closed

fail to compile on linux OS #20

wcy168 opened this issue Jul 29, 2022 · 3 comments

Comments

@wcy168
Copy link

wcy168 commented Jul 29, 2022

I used aedis::resp3::request in two different header files, and the link failed.The following is the error message

/usr/bin/ld: ./server.o: in function aedis::adapter::detail::from_bulk(bool&, boost::basic_string_view<char, std::char_traits<char> >, boost::system::error_code&)': /usr/local/include/aedis/adapter/detail/adapters.hpp:68: multiple definition of aedis::adapter::detail::from_bulk(bool&, boost::basic_string_view<char, std::char_traits >, boost::system::error_code&)'; ./redis_client.o:/usr/local/include/aedis/adapter/detail/adapters.hpp:68: first defined here
/usr/bin/ld: ./server.o: in function aedis::adapter::detail::set_on_resp3_error(aedis::resp3::type, boost::system::error_code&)': /usr/local/include/aedis/adapter/detail/adapters.hpp:93: multiple definition of aedis::adapter::detail::set_on_resp3_error(aedis::resp3::type, boost::system::error_code&)'; ./redis_client.o:/usr/local/include/aedis/adapter/detail/adapters.hpp:92: first defined here
/usr/bin/ld: ./server.o: in function aedis::adapt()': /usr/local/include/aedis/adapt.hpp:141: multiple definition of aedis::adapt()'; ./redis_client.o:/usr/local/include/aedis/adapt.hpp:141: first defined here
/usr/bin/ld: ./server.o: in function aedis::adapter::detail::parse_double(char const*, unsigned long, boost::system::error_code&)': /usr/local/include/aedis/adapter/detail/adapters.hpp:42: multiple definition of aedis::adapter::detail::parse_double(char const*, unsigned long, boost::system::error_code&)'; ./redis_client.o:/usr/local/include/aedis/adapter/detail/adapters.hpp:42: first defined here
/usr/bin/ld: ./server.o: in function aedis::adapter::detail::from_bulk(double&, boost::basic_string_view<char, std::char_traits<char> >, boost::system::error_code&)': /usr/local/include/aedis/adapter/detail/adapters.hpp:75: multiple definition of aedis::adapter::detail::from_bulk(double&, boost::basic_string_view<char, std::char_traits >, boost::system::error_code&)'; ./redis_client.o:/usr/local/include/aedis/adapter/detail/adapters.hpp:75: first defined here
collect2: 错误:ld 返回 1

@mzimbres
Copy link
Collaborator

This is probably a misture of src.hpp. Does this comentou help you further #15 (comment)
?

@wcy168
Copy link
Author

wcy168 commented Jul 29, 2022

But it can be compiled in windows

@wcy168
Copy link
Author

wcy168 commented Jul 30, 2022

Now it works normally. I made a mistake and an obsolete file was introduced into the compilation

@wcy168 wcy168 closed this as completed Jul 30, 2022
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

2 participants