Declaring extern NSString causes linker error

后端 未结 4 1656
旧巷少年郎
旧巷少年郎 2021-02-07 11:17

This is ridiculous, im trying to create a sound bool to turn of in app sounds. I keep getting

Undefined symbols for architecture i386:
\"_kPlaySoundPrefsKey\",         


        
4条回答
  •  花落未央
    2021-02-07 12:17

    I am also got the same error even if I am properly declared and define the extern const string , The problem is, my constant file not in the compile source list .

    Make sure that your .m file appears in the "Compile Sources" Build Phase for your build target. Sometimes, adding files to a project in Xcode doesn't add all implementation files to the appropriate targets.

    Hope this will helpful for some people. Refe: linker-error-undefined-symbols-symbols-not-found

提交回复
热议问题