[Swfit Tutorial] Duplicate Symbol Error

edited January 2019 in iOS
This discussion was created from comments split from: 'Install pod' fails, reporting no such GitHub repo.

Comments

  • Hi Eric, thanks for the tip.

    I did manage to set up the sample project, connect with the board and saw the debug msgs turn up.
    However, it all went very wrong when I tried to add the Start/Stop buttons.

    Over the past several hours, much to my frustration, I keep getting this msg:

    duplicate symbol _MBL_MW_MODULE_TYPE_NA in:
        /Users/tobiasjonch/Library/Developer/Xcode/DerivedData/StarterProject-fhfhzkzfhfjbjuchpxbvhdktsnut/Build/Intermediates.noindex/StarterProject.build/Debug-iphoneos/iOS.build/Objects-normal/arm64/DeviceState.o
        /Users/tobiasjonch/Library/Developer/Xcode/DerivedData/StarterProject-fhfhzkzfhfjbjuchpxbvhdktsnut/Build/Intermediates.noindex/StarterProject.build/Debug-iphoneos/iOS.build/Objects-normal/arm64/DeviceViewController.o
    ld: 1 duplicate symbol for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    The build breaks with these lines:

    let board = device.board
            guard mbl_mw_metawearboard_lookup_module(board, MBL_MW_MODULE_ACCELEROMETER) != MBL_MW_MODULE_TYPE_NA else {
                print("No accelerometer")
                return
            }
    

    I've tried more things than you care to know, but here's a few:
    * Clean and rebuild
    * Flipping GCC_NO_COMMON_BLOCKS
    * Opening StarterProject.xcworkspace rather than StarterProject.xcodeproj
    * Checked that I'm using libc++
    * Deintegrate pods and reinstalling.

    Hope you (or anyone!) can help. Please be specific for navigating to any settings, as I'm fairly new to xcode as well.

    Thank you,
    Tobias

  • The Swift tutorial address this issue.

  • Thank you Eric for the quick reply (and sorry for bundling my questions).

    First, be honest, were those sections there yesterday? Did I really miss them?

    Second, it would be really great if the site notified thread followers when a topic is split. I might never have gotten your answer if I didn't return to the thread overview.

    In any case, thanks again!

  • edited January 2019

    @Tobias said:
    Thank you Eric for the quick reply (and sorry for bundling my questions).

    First, be honest, were those sections there yesterday? Did I really miss them?

    The section has been there for a long time.

  • In that case I sincerely apologize for taking up your time. I need to shape up :(
    Thanks.

  • @Tobias,

    No worries, we are happy you posted on the forum.

    We did update our tutorials a little while ago but maybe your stuff was cached so you didn't see the changes until now. We are going to keep updating tutorials so keep checking back.

    By the way, this is a known Swift issue but we are waiting for a fix from Apple (it is an issue having to do with cpp header files).

Sign In or Register to comment.