Page 1 of 1

Build SmartfoxClient API C++ on Mac

Posted: 11 Aug 2015, 18:23
by caldelta
Hello I just build the latest C++ API 1.6.0 to integrate it to cocos2d-x version 3.7

Everything seem ok unless the error linker below:

Using Eclipse and Cross G++ compiler and follow the tutorial here

http://docs2x.smartfoxserver.com/Gettin ... nt-api-cpp

. Do I missing something ? Please help ...

Code: Select all

Building target: libSFS.dylib
Undefined symbols for architecture x86_64:
  "_compress", referenced from:
      Sfs2X::Util::ByteArray::Compress() in ByteArray.o
     (maybe you meant: __ZNK5boost4asio3ssl6detail17openssl_init_base7do_init28get_null_compression_methodsEv, __ZN5boost4asio3ssl6detail17openssl_init_base28get_null_compression_methodsEv )
  "_uncompress", referenced from:
      Sfs2X::Util::ByteArray::Uncompress() in ByteArray.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libSFS.dylib] Error 1

Re: Build SmartfoxClient API C++ on Mac

Posted: 11 Aug 2015, 19:54
by caldelta
Fine, I need to add zLib library to project for it go successful.

But when i compile my source, it said

Code: Select all

libSmartFoxClientAPI.dylib, file was built for x86_64 which is not the architecture being linked (arm64): libSmartFoxClientAPI.dylib
How do I build the library link to arm64?

Re: Build SmartfoxClient API C++ on Mac

Posted: 12 Aug 2015, 15:26
by Lapo
Hi,
the API should be compiled for the architecture you are targeting.
If you're working on a project for iOS or Android (which use the ARM processor) then you will have to compile the API for that platform.

Can you clarify what you're trying to do?

Thanks