Compiling issues with 2.2.0git and XCode 11.4

Subforum for discussion and help with ScummVM's iPhone port

Moderator: ScummVM Team

Post Reply
JohnnyW
Posts: 33
Joined: Sun Sep 21, 2014 11:02 am

Compiling issues with 2.2.0git and XCode 11.4

Post by JohnnyW »

Hi all, I've managed to do this in the past, but it's been a while. I followed the instructions here (https://wiki.scummvm.org/index.php?titl ... CCompiling), but I keep getting compilation errors in XCode.

If I compile for macOS I get this error:
/common/scummsys.h:295:12: 'SDL_endian.h' file not found

/Users/johnny/Documents/XCode/scummvm/engines/zvision/video/zork_avi_decoder.cpp:23:10: In file included from /Users/johnny/Documents/XCode/scummvm/engines/zvision/video/zork_avi_decoder.cpp:23:
If I compile for iOS I get this error:
Building for iOS Simulator, but the linked library 'libjpeg.a' was built for macOS.
Building for iOS Simulator, but the linked library 'libfreetype.a' was built for macOS.
Building for iOS Simulator, but the linked library 'libpng16.a' was built for macOS.
(And yes, I cleaned the Build folder.)

Sorry for not knowing much about this stuff. I'd actually love to learn more!

Thanks for any help!
Last edited by JohnnyW on Sun Apr 12, 2020 2:51 pm, edited 1 time in total.

User avatar
criezy
ScummVM Developer
Posts: 741
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Compiling issues with 2.2.0git and XCode 11

Post by criezy »

The error for iOS is one that we discussed a few days ago in the Discord/IRC channels. The issue is that the path to the libraries points to the libraries in /usr/local/lib instead of where the iOS libraries are. That is an issue related to the fact create_project creates a Xcode project that can be used both for iOS and macOS builds. I think I have an idea to fix that and was planning to look at it this weekend. In the meantime you can manually fix the paths in Xcode. In the Project Navigator under Frameworks, change the path for all the static libraries used by iOS (all of them except libSDL2.a and libSDL2main.a that are only used for the macOS build).

JohnnyW
Posts: 33
Joined: Sun Sep 21, 2014 11:02 am

Re: Compiling issues with 2.2.0git and XCode 11.4

Post by JohnnyW »

Thanks. I pointed the library files to the ones in the lib folder of the build library. It fixed things for two of them, but now I got this odd one:
Building for iOS Simulator, but the linked library 'libjpeg.a' was built for iOS.
Building for iOS... but the library was built for iOS! Hmm.

Edit: Googling around, it looks like this is a new issue specific to XCode 11.4. I guess I will have to wait?

User avatar
criezy
ScummVM Developer
Posts: 741
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Compiling issues with 2.2.0git and XCode 11

Post by criezy »

That is indeed a strange one.
I have not seen that one before, but I don't think I have ever tried to compile for the simulator with Xcode 11.4.

Note also that I have created a pull request yesterday to try to fix the iOS/macOS library path issues.

For the SDL_endian.h issue when building for macOS, this seems to indicate you do not have the SDL library in /usr/local. Normally SDL_endian.h would be found in either /usr/local/include/SDL/SDL_endian.h (for SDL 1.2) or /usr/local/include/SDL2/SDL_endian.h (for SDL 2.0)

User avatar
criezy
ScummVM Developer
Posts: 741
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Compiling issues with 2.2.0git and XCode 11.4

Post by criezy »

I have now tried building for the iOS simulator (iPhone 11 Pro Max and iPhone 11) with Xcode 11.4, and it worked for me.

JohnnyW
Posts: 33
Joined: Sun Sep 21, 2014 11:02 am

Re: Compiling issues with 2.2.0git and XCode 11.4

Post by JohnnyW »

Hey, thanks for the SDL tip.

Yes, not sure why you're not getting that error. libjpeg.a doesn't seem to work with iOS Simulators.

Does this mean I need two projects, btw? One for macOS and one for iOS?

Post Reply