Upgrading Project - Problems with arm64 architecture

Upgrading Project - Problems with arm64 architecture
0

#1

Hello,

I’ve been tasked with upgrading one of our old projects built with cocos 2.0.4. I realize this is quite old. I need to build it for iOS only.

I’m trying to build with XCode 9.2 (it was originally built with XCode4 as I understand), but I keep encountering problems with linking.

I have set architectures as follows:

My Other Linker Flags are set as:

My Framework/header/library search paths are all similar to:

I have linked libraries:

As well as compiled sources:

This leads me to errors as below:

What am I missing? How do I build the arm64 architecture?


#2

You are running 2.04 now? Are you planning to upgrade versions at all?


#3

Not unless I have too, the project is quite large and was previously maintained by a team of 5, now its just me (sorry, I realize that isn’t ideal).

I’ve used this: https://github.com/cocos2d/cocos2d-x/tree/cocos2d-2.0-x-2.0.4

to look for any related documentation.


#4

What’s considered large?

Did it run in iOS previously?


#5

The repo is about 20gb. It did run previously on iOS (I believe using xcode4).


#6

The static libraries you are using are not built for amd64. So you would need to find the source versions of all the a files you are linking with and recompile them.


#7

At a minimum this is true. Good advice.


#8

How could I ensure I make the libraries with arm64? I’ve tried several commands similar to:

xcodebuild -project cocos2dx.xcodeproj -target cocos2dx -sdk iphoneos -configuration Debug clean build


#9

I have confirmed that my cocos project is built with arm64.

I’ve ran the command:
xcodebuild -project cocos2dx.xcodeproj -target cocos2dx -sdk iphoneos -configuration Debug clean build

and then running:
lipo -info build/Debug-iphoneos/libcocos2dx.a

The result is:
Architectures in the fat file: build/Debug-iphoneos/libcocos2dx.a are: armv7 arm64

If I’ve somehow missed a step please let me know. I’m linking this .a file (libcocos2dx.a) to my build in the Link Binaries with Libraries step:


#10

I have built the project with cocos 2.2.6 and now encounter more linkage errors. If I remove arm64 from the valid architectures I instead get the error “symbol(s) not found for architecture armv7”. What am I doing wrong here?


#11

@corytrese are you building v2.x for 64-bit?


#12

I do get:
Architectures in the fat file: build/Debug-iphoneos/libcocos2dx.a are: armv7 arm64


#13

I build arm64 on iOS using XCode. Cocos2d-x v2.2.6 with some changes.

			VALID_ARCHS = "arm64 armv7";