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

Unable to compile C++ with latest toolchain and 14.7 SDK #50

Closed
sherrellbc opened this issue Sep 14, 2021 · 3 comments
Closed

Unable to compile C++ with latest toolchain and 14.7 SDK #50

sherrellbc opened this issue Sep 14, 2021 · 3 comments

Comments

@sherrellbc
Copy link

sherrellbc commented Sep 14, 2021

What are the steps to reproduce this issue?

  1. Create iPhone tool template
  2. Attempt to compile c++ code (replace main.m with main.cpp in Makefile)
#include <iostream>

int main() {
    std::cout << "Hello World!";
    return 0;
}

What happens?

Compilation fails

What were you expecting to happen?

Successful compilation

Any logs, error output, etc?

$ make
> Making all for tool exampletool…
==> Compiling main.cpp (armv7)…
/opt/theos/sdks/iPhoneOS14.7.sdk/usr/include/c++/v1/module.modulemap:4:8: error: redefinition of module 'std_config'
module std_config [system] [extern_c] {
       ^
/opt/theos/toolchain/linux/iphone/bin/../include/c++/v1/module.modulemap:4:8: note: previously defined here
module std_config [system] [extern_c] {
       ^
/opt/theos/sdks/iPhoneOS14.7.sdk/usr/include/c++/v1/module.modulemap:8:8: error: redefinition of module 'std'
module std [system] {
       ^
/opt/theos/toolchain/linux/iphone/bin/../include/c++/v1/module.modulemap:8:8: note: previously defined here
module std [system] {
       ^
...

==> Compiling main.cpp (arm64)…
/opt/theos/sdks/iPhoneOS14.7.sdk/usr/include/c++/v1/module.modulemap:4:8: error: redefinition of module 'std_config'
module std_config [system] [extern_c] {
       ^
/opt/theos/toolchain/linux/iphone/bin/../include/c++/v1/module.modulemap:4:8: note: previously defined here
module std_config [system] [extern_c] {
       ^
/opt/theos/sdks/iPhoneOS14.7.sdk/usr/include/c++/v1/module.modulemap:8:8: error: redefinition of module 'std'
module std [system] {
       ^
...

What versions of software are you using?

Operating System: Linux/Ubuntu 18.04

Toolchain Version: latest (non-swift) from instructions

SDK Version: 14.7 (generated by using the provided sdk create script)

@sherrellbc
Copy link
Author

Sorry, I updated the output to reflect use of the 14.7 SDK I generated using create_patched_sdk.sh.

It seems that the 14.4 SDK available from the repo will compile this code just fine. Interestingly, there is no $SDK/usr/include/c++ directory in the 14.4 SDK as provided by the repo. But there is one in the 14.7 SDK generated by the script (and in the SDK sources). The toolchain provides its own c++ directory at $TOOLCHAIN/include/c++

@sherrellbc sherrellbc changed the title Unable to compile C++ with latest toolchain and 14.4 SDK Unable to compile C++ with latest toolchain and 14.7 SDK Sep 14, 2021
@sherrellbc
Copy link
Author

THEOS is the latest from master as of last week sometime. Same for the create SDK script I linked.

@theos theos deleted a comment Jan 8, 2022
@theos theos deleted a comment Jan 8, 2022
@theos theos deleted a comment Jan 8, 2022
@PoomSmart PoomSmart transferred this issue from theos/theos Feb 20, 2022
@uroboro
Copy link
Member

uroboro commented Feb 20, 2022

Fixed with fd931ca

@uroboro uroboro closed this as completed Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@uroboro @sherrellbc and others