mumble-voip / mumble-iphoneos

Mumble client for iOS-based devices
https://www.mumble.info
Other
193 stars 79 forks source link

Cannot build the project due to invalid .pch file #131

Open kittisak-phetrungnapha opened 3 years ago

kittisak-phetrungnapha commented 3 years ago

Hi, I am trying to build the project but found the below errors.

error: input is not a PCH file: '/Users/kittisak/Library/Developer/Xcode/DerivedData/Mumble-dseistgcfzlkmifyiefqlrpdtbmm/Build/Intermediates.noindex/PrecompiledHeaders/SharedPrecompiledHeaders/6834873383108777343/CELT-0.7.pch.gch'

fatal error: file '/Users/kittisak/Library/Developer/Xcode/DerivedData/Mumble-dseistgcfzlkmifyiefqlrpdtbmm/Build/Intermediates.noindex/PrecompiledHeaders/SharedPrecompiledHeaders/6834873383108777343/CELT-0.7.pch.gch' is not a valid precompiled PCH file

I searched that file and this is its content.

//
// Prefix header for all source files of the 'CELT-0.7' target in the 'CELT-0.7' project
//

#ifdef __OBJC__
    #import <Foundation/Foundation.h>
#endif

I am using Xcode 13.7.

Could you suggest me how to fix them? Thank you.

jasperblues commented 3 years ago

@itopstack I just faced the same, and managed to get it to build by:

Open the Xcode project, Try to do the following steps, XCode->File->Workspace Settings->Build System, select the option "Legacy Build System".

^-- This is deprecated, so we'll need a better solution long term.

Krzmbrzl commented 3 years ago

Without knowing any details about how to build the code here: usually a PCH file gets generated on-the-fly and therefore I would try to delete it before a fresh build attempt. Maybe that is enough to solve the issue :thinking:

Kissaki commented 5 months ago

I am running into this same issue when trying to build mumblekit, which also includes a celt build, on CI (GitHub Actions).

❌  error: input is not a PCH file: '/Users/runner/work/mumblekit/mumblekit/3rdparty/celt-0.7.0-build/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/6029267988201565908/CELT-0.7.pch.gch'
Kissaki commented 5 months ago

xcode 13.1 with legacy build system works

xcodebuild -UseModernBuildSystem=NO

xcode 14.2 doesn't have the flag anymore

I haven't checked where it disappears specifically. (Probably 14?)

Kissaki commented 5 months ago

@jasperblues When changing that setting, does that save to the project file as a change? (I assume Mumble.xcodeproj?)

Can you create PR for that?

Kissaki commented 5 months ago

I added CI to this project, so there's proof it compiles with legacy build system.

But I don't have a macOS or xcode. So I can't make the project file setting change.

jasperblues commented 5 months ago

@Kissaki would love to help, however I don't have time to work on Mumble at the moment.

Its also possible to freshen the code so that it compiles without requiring legacy build settings and to remove ARC. I did this on a forked code-base owned by a previous client, as well as added support for stereo playback and recording. (I no longer have access to this code, but it would be easy to recreate)