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

IOS Building Error V4_MAPPED #230

Closed
captainTvZx opened this issue Sep 7, 2020 · 8 comments
Closed

IOS Building Error V4_MAPPED #230

captainTvZx opened this issue Sep 7, 2020 · 8 comments

Comments

@captainTvZx
Copy link

F:\Unreal Projects\StackUp\Plugins\SocketIO\Source\ThirdParty\asio\asio\include\asio\ip\resolver_base.hpp:79:5: error: declaration shadows a variable in namespace 'asio::ip' [-Werror,-Wshadow] v4_mapped = ASIO_OS_DEF(AI_V4MAPPED), F:\Unreal Projects\StackUp\Plugins\SocketIO\Source\ThirdParty\asio\asio\include\asio\ip\address_v6.hpp:295:20: note: previous declaration is here enum v4_mapped_t { v4_mapped };

Please help !

@getnamo
Copy link
Owner

getnamo commented Sep 8, 2020

Version of plugin? v4_mapped suggests an underlying library include issue, check that you're using the latest commit for asio: https://github.com/getnamo/asio/tree/14dd8e3b0effdcf9da37bddcbfcd2ba822d3f58a you may need to add an ignore for shadow variable warning or #if around https://github.com/getnamo/asio/blob/14dd8e3b0effdcf9da37bddcbfcd2ba822d3f58a/asio/include/asio/ip/address_v6.hpp#L295

@lui-shex
Copy link

Is this issue resovled?

@finger563
Copy link
Contributor

I also have this issue when building with 4.26 on a mac for ios

@finger563
Copy link
Contributor

finger563 commented Dec 18, 2020

if you change lines 66-90 in Source/ThirdParty/asio/asio/include/asio/ip/resolver_base.hpp from:

#if (defined(PLATFORM_MAC) && PLATFORM_MAC)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#endif

  enum flags
  {
    canonical_name = ASIO_OS_DEF(AI_CANONNAME),
    passive = ASIO_OS_DEF(AI_PASSIVE),
    numeric_host = ASIO_OS_DEF(AI_NUMERICHOST),
    numeric_service = ASIO_OS_DEF(AI_NUMERICSERV),
    v4_mapped = ASIO_OS_DEF(AI_V4MAPPED),
    all_matching = ASIO_OS_DEF(AI_ALL),
    address_configured = ASIO_OS_DEF(AI_ADDRCONFIG)
  };

#if defined(PLATFORM_LINUX) && PLATFORM_LINUX
#pragma clang diagnostic pop
#endif

#if (defined(PLATFORM_MAC) && PLATFORM_MAC)
#pragma GCC diagnostic pop
#endif

to:

#if (defined(PLATFORM_MAC) && PLATFORM_MAC) || (defined(PLATFORM_IOS) && PLATFORM_IOS)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#endif

  enum flags
  {
    canonical_name = ASIO_OS_DEF(AI_CANONNAME),
    passive = ASIO_OS_DEF(AI_PASSIVE),
    numeric_host = ASIO_OS_DEF(AI_NUMERICHOST),
    numeric_service = ASIO_OS_DEF(AI_NUMERICSERV),
    v4_mapped = ASIO_OS_DEF(AI_V4MAPPED),
    all_matching = ASIO_OS_DEF(AI_ALL),
    address_configured = ASIO_OS_DEF(AI_ADDRCONFIG)
  };

#if defined(PLATFORM_LINUX) && PLATFORM_LINUX
#pragma clang diagnostic pop
#endif

#if (defined(PLATFORM_MAC) && PLATFORM_MAC) || (defined(PLATFORM_IOS) && PLATFORM_IOS)
#pragma GCC diagnostic pop
#endif

It will compile - note the only addition is the || (defined(PLATFORM_IOS) && PLATFORM_IOS)

@smeeguel
Copy link

smeeguel commented Dec 28, 2020

Confirming the change by @finger563 got iOS compiling and running again.

My workflow using Windows 10 (remote compiling iOS on Macbook Air):

  • Downloaded and unzipped 1.5.1 to my project's Plugins folder
  • Deleted Plugins/socket/Binaries
  • Edited 'Source/ThirdParty/asio/asio/include/asio/ip/resolver_base.hpp' with the above changes
  • Launched project, forcing a repackage of the plugin
  • Packaged iOS

getnamo added a commit that referenced this issue Dec 28, 2020
@getnamo
Copy link
Owner

getnamo commented Dec 28, 2020

Fix merged in master and released as https://github.com/getnamo/socketio-client-ue4/releases/tag/1.5.5

@getnamo
Copy link
Owner

getnamo commented Apr 20, 2022

Working in latest marketplace

@getnamo getnamo closed this as completed Apr 20, 2022
@captainTvZx
Copy link
Author

@getnamo Thank u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants