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

"Ignoring duplicate library '-lc++'" compiler warning with XCode 15 #2493

Closed
1 task
stevekellyhpe opened this issue Aug 9, 2023 · 11 comments
Closed
1 task
Labels

Comments

@stevekellyhpe
Copy link

Description

The warning "Ignoring duplicate library '-lc++'" is shown when building a project that has integrated the AppCenter SDK via Swift Package on Xcode 15. (Most recently reproduced with Xcode 15 beta 6 and AppCenter 5.0.3

Repro Steps

Please list the steps used to reproduce your issue.

  1. Create a new project in XCode
  2. Add the AppCenter SDK via Swift Package (I also included the AppCenter Crashes module)
  3. Import AppCenter somewhere in the project
  4. Build and note the duplicate library warning

Details

  1. Which SDK version are you using?
    • e.g. 5.0.3
  2. Which OS version did you experience the issue on?
    • e.g. iOS 15-17
  3. Which Xcode version did you build the app with?
    • e.g. Xcode 15 beta 6
  4. Which Cocoapods version are you using (run pod --version)?
    • e.g. NA
  5. What device version did you see this error on? Were you using an emulator or a physical device?
    • e.g. iPhone 14
  6. What language are you using?
    • Objective C
    • [ x ] Swift
  7. What third party libraries are you using?
    • None
  8. Please enable verbose logging for your app using MSAppCenter.setLogLevel(.verbose) before your call to MSAppCenter.start(...) for Swift, or [MSAppCenter setLogLevel:MSLogLevelVerbose] before [MSAppCenter start: ...] for Objective C and include the logs here:
  • NA (compiler warning)
@AnatolyPristensky
Copy link
Contributor

Hello @stevekellyhpe, I was able to reproduce this warning on Xcode15 beta 6.
But according Xcode 15 Beta 6 Release Notes (Known issues) was found the following:

  • Use of one C++ class template with multiple specializations in Swift could lead to duplicate definition link errors. (107757051)

Also I found that these warnings also appears for other SDKs (for example - getsentry/sentry-cocoa#3122)

I think this is an XCode15 Beta 6 issue. Let's wait for further betas and check if issue still persists.

@stevekellyhpe
Copy link
Author

BTW, it appears the Sentry SDK that you linked to addressed the issue via change to their Package.swift file:

getsentry/sentry-cocoa#3188

@JonathanEsposito
Copy link

issue seems still to be present in Xcode 15 Beta 7

@clausjoergensen
Copy link

This is still an issue in the Xcode 15 RC. We need AppCenter to update the Package.swift to no longer include

.linkedLibrary("z"),
.linkedLibrary("sqlite3"),

@MikhailSuendukov
Copy link
Contributor

I tried to remove these packages from Package.swift, but unfortunately it did not solve the problem. You can try it using SDK version from fix-duplicate-library'-lc++' branch.

@DmitriyKirakosyan
Copy link
Contributor

Can anyone test if it is still broken on Xcode 15.1 beta?

@stevekellyhpe
Copy link
Author

@DmitriyKirakosyan I can still reproduce it with the XCode 15.1 Beta, and appcenter-sdk-apple version 5.0.4. (This is with a brand new project that imports AppCenter and nothing else.)

@cho-trackman
Copy link

Please fix this (it make it impossible to run unit tests in Xcode 15) :)

@AnatolyPristensky
Copy link
Contributor

@cho-trackman, I've tried to reproduce it on Xcode 15.1 beta 2 - and found that the issue is gone. Please, try to use this version of Xcode and let us know if it helps.

@stevekellyhpe
Copy link
Author

I'm also no longer able to reproduce this on XCode 15.1 beta 2.

@DmitriyKirakosyan
Copy link
Contributor

I'm going to close it as fixed in new version of Xcode. If it reoccurs, please inform me.

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

No branches or pull requests

7 participants