Bug 15102 - Build fails to compile without no-link linker option
Summary: Build fails to compile without no-link linker option
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-10-01 14:14 UTC by sharat
Modified: 2013-10-01 16:29 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description sharat 2013-10-01 14:14:51 UTC
We recently allowed Xamarin studio to update when we noticed this problem.  I unfortunately don't remember what our prior version of either Xamarin Studio or Xamarin iOS for which this working earlier, but it could have been a much older version.  I tried rolling back to the earliest iOS version I saw available for install(6.4.0) but that didn't seem to help at all. The doc webpage on the subject said I should file a report, so here I am.

  It seems to be failing to find the AudioComponent files from the SDK.  The target is for the 6.1 iOS SDK.


Error output
....
Undefined symbols for architecture armv7:
  "_AudioComponentFindNext", referenced from:
      FlxOutput::FlxOutput(void*)in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
  "_AudioComponentInstanceDispose", referenced from:
      FlxOutput::~FlxOutput()in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
      FlxOutput::~FlxOutput()in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
  "_AudioComponentInstanceNew", referenced from:
      FlxOutput::FlxOutput(void*)in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
  "_AudioOutputUnitStart", referenced from:
      FlxOutput::FlxOutput(void*)in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
      FlxOutput::StartOutputUnit()      in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
  "_AudioOutputUnitStop", referenced from:
      FlxOutput::~FlxOutput()in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
      FlxOutput::~FlxOutput()in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
      FlxOutput::StopOutputUnit()      in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
  "_AudioSessionGetProperty", referenced from:
      AresiOSPlatform::Init()      in libAres-retail.a(AresiOSPlatform.mm.20.o)
      AresiOSPlatform::UpdateIsAudioPlaying()       in libAres-retail.a(AresiOSPlatform.mm.20.o)
  "_AudioUnitInitialize", referenced from:
      FlxOutput::FlxOutput(void*)in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
  "_AudioUnitSetProperty", referenced from:
      FlxOutput::FlxOutput(void*)in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
  "_AudioUnitUninitialize", referenced from:
      FlxOutput::~FlxOutput()in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
      FlxOutput::~FlxOutput()in libfelix-retail.a(FlxOutput_iOS.cpp.14.o)
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

error MT5201: Native linking failed. Please review user flags provided to gcc: ....
Comment 1 Sebastien Pouliot 2013-10-01 14:25:03 UTC
This looks like a known issue (fixed but not yet released). Please try adding:

    -cxx

to your "Project Options", "iOS Build", "Additional mtouch arguments".

That will instruct mtouch to use the C++ compiler, which seems required based on the missing symbols above.

If that does not solve it please re-open the bug report and include the full build log (including `-v -v -v -v` in your "Additional mtouch arguments").
Comment 3 Sebastien Pouliot 2013-10-01 14:50:52 UTC
Ok, it looks like your native libraries requires AudioUnit but it's not automagically (natively) linked since it's not used by managed code.

Try adding "-framework AudioUnit" inside the `-gcc_flags` of your Project Options.

That might be caused by code changes or because the (managed) linker is smarter (in recent versions of XI)  and could removed more unused reference (which elimitated AudioUnit from the managed code).
Comment 5 Sebastien Pouliot 2013-10-01 15:14:59 UTC
Sorry it's "AudioToolbox" - one of the few misnamed frameworks (where the official documented name does not match the framework file name).

So "-framework AudioToolbox" inside the `-gcc_flags` of your Project Options.
Comment 6 sharat 2013-10-01 16:29:23 UTC
Thanks, I think adding the AudioToolbox framework fixed it!