Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5 RC4 Build error while trying to build a plugin for iOS Simulator #62162

Closed
gumaciel opened this issue Jun 18, 2022 · 7 comments · Fixed by godotengine/godot-ios-plugins#35

Comments

@gumaciel
Copy link
Contributor

gumaciel commented Jun 18, 2022

Godot version

3.5 RC4

System information

MacOS Monterey 12.2.1, Intel Processor

Issue description

Hello, I was trying to build for the new version that will come out, 3.5, and I had an error while trying to build a plugin for Simulator x86_64, 3.5 RC4


g++ -o plugin/admob/src/main/admob.o -c -fomit-frame-pointer -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DPTRCALL_ENABLED -DGLES_ENABLED -std=gnu++14 -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DIPHONE_ENABLED -DUNIX_ENABLED -DCOREAUDIO_ENABLED -fmodules -fcxx-modules -mios-simulator-version-min=10.0 -fobjc-arc -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -fno-exceptions -Wno-ambiguous-macro -Wall -Werror=return-type -arch x86_64 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/main -Igodot/core -Igodot/core/os -Igodot/core/platform -Igodot/platform/iphone -Igodot/modules -Igodot/scene -Igodot/servers -Igodot/drivers -Igodot/thirdparty -Fplugin/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.xcframework/ios-arm64_x86_64-simulator -Fplugin/Pods/GoogleUserMessagingPlatform/Frameworks/Release/UserMessagingPlatform.xcframework/ios-arm64_x86_64-simulator plugin/admob/src/main/admob.mm
While building module 'Foundation' imported from plugin/admob/src/main/admob.mm:9:
While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
While building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
In file included from <module-includes>:98:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/include/wchar.h:91:
In file included from godot/core/os/time.h:34:
In file included from godot/core/class_db.h:34:
In file included from godot/core/method_bind.h:34:
In file included from godot/core/list.h:34:
In file included from godot/core/error_macros.h:34:
In file included from godot/core/safe_refcount.h:34:
godot/core/typedefs.h:114:1:{114:1-114:19}: error: templates must have C++ linkage [2]
 template <class T>
 ^~~~~~~~~~~~~~~~~~
<module-includes>:97:1: note: extern "C" language linkage specification begins here [2]
 extern "C" {
 ^

Link of source code: https://github.com/Poing-Studios/godot-admob-ios
Godot source code: https://downloads.tuxfamily.org/godotengine/3.5/rc4/godot-3.5-rc4.tar.xz
Command used: ./scripts/release_static_library.sh 3.x or ./scripts/release_xcframework.sh 3.x

Original Issue on godot-ios-plugins repository: godotengine/godot-ios-plugins#34

Steps to reproduce

  1. Clone the repository of iOS Plugin
  2. Build to iOS Simulator
  3. See the error

Minimal reproduction project

https://github.com/godotengine/godot-ios-plugins

or

https://github.com/Poing-Studios/godot-admob-ios

@akien-mga
Copy link
Member

As found by @bruvzg in godotengine/godot-ios-plugins#34, this seems to be a clash between the new Time singleton in time.h and some system header.

So we'll either need to rename our file (ugh...) or find a way not to clash with the system header.

@bruvzg
Copy link
Member

bruvzg commented Jun 18, 2022

It's probably can be fixed by removing 'godot/core/os' from here, might need some of the includes to be updated to have full path, but it's probably to reduce it to the . and godot anyway.

https://github.com/godotengine/godot-ios-plugins/blob/dd071eee24d199e50d90e5029105eff3fdc343a3/SConstruct#L155-L168

@akien-mga
Copy link
Member

Ah indeed these are wrong, only . and arguably godot should be in there.

@bruvzg
Copy link
Member

bruvzg commented Jun 18, 2022

Removing godot/core/os fixes the issue for all plugins in https://github.com/godotengine/godot-ios-plugins

But removing all except . and godot won't work without some changes to godot code.

@bruvzg
Copy link
Member

bruvzg commented Jun 18, 2022

Actually, it can be reduced to ., godot, godot/platform/iphone which seems reasonable.

godotengine/godot-ios-plugins#35

@bruvzg
Copy link
Member

bruvzg commented Jun 18, 2022

For the reference godotengine/godot-ios-plugins#35 only fixed official plugins, https://github.com/Poing-Studios/godot-admob-ios should have SConstruct updated in the same way to work.

@gumaciel
Copy link
Contributor Author

Thank you, it seems to solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants