heroiclabs / nakama-cpp

Generic C/C++ client for Nakama server.
https://heroiclabs.com/docs/cpp-client-guide
Apache License 2.0
69 stars 25 forks source link

Nakama cpp not compile xCode 12 #34

Closed raz0r007 closed 3 years ago

raz0r007 commented 3 years ago

Hi, When I try to compile Nakama C++ SDK in xCode 12 using a Simulator (example: iPhone X), it doesn't work. Using a real device it works perfectly. The problem is in simulators with different architectures.

Anyone can help me?

Error:

ld: in /nakama_cocos2d_sdk/libs/ios/libnakama-cpp.a(BaseClient.cpp.o), building for iOS Simulator, but linking in object file built for iOS, file ‘/nakama_cocos2d_sdk/libs/ios/libnakama-cpp.a’ for architecture arm64

lugehorsam commented 3 years ago

@raz0r007 I believe you need to link the mac library in for simulator builds rather than the ios library.

raz0r007 commented 3 years ago

I just want to run the same code in real devices and simulators for test a multiplayer game. That's impossible? Should I compile different codes? Should I compile nakama-ios for real devices and nakama-mac for simulators?

Dimon4eg commented 3 years ago

Nakama C++ supports both iOS devices and simulators. But it doesn't support new Xcode 12 yet. As a workaround you can try to link Mac library.

raz0r007 commented 3 years ago

Thanks @Dimon4eg 👍 Please let us know in this topic, when it's fixed.

lugehorsam commented 3 years ago

@raz0r007 there is actually a bug in Xcode 12 related to a now unsupported build setting that causes your problem.

Could you try creating a user defined build setting in Xcode called VALID_ARCHS? When you create it, it should populate with some different architectures. Clear that list and then run the project and it should resolve your issue.

Screen Shot 2020-09-22 at 10 25 47 AM
raz0r007 commented 3 years ago

Hi @lugehorsam Yes, I've tested with VALID_ARCHS, without good results.

VALID_ARCHS = arm64 armv7

lugehorsam commented 3 years ago

@raz0r007 you need to clear the list so it is left blank.

raz0r007 commented 3 years ago

VALID_ARCHS = arm64 armv7 or VALID_ARCHS empty

Same results. Not compile.

raz0r007 commented 3 years ago

Is there any estimated date to fix this issue? Just for know...

raz0r007 commented 3 years ago

Fixed! This should be the setting: VALID_ARCHS = arm64 armv7 armv7s x86_64