title: xCode 4.3.2 linking error, but the arch DOES exist. Why?
body: <p>I was trying to add AMR-NB decoding support to an iOS app, which has been successfully done before. But since I upgraded the framework I used (PhoneGap, now as Cordova), I started a new project and migrate all codes to the new one, the AMR-NB lib starts to make error during linking phrase.</p>
  
  <p><img src="https://i.stack.imgur.com/JJT0F.png" alt="enter image description here"></p>
  
  <p>I've been checking the .a lib file with 'file' and 'lipo -info' command, and made sure the fat lib contains arch for i386, and it's already included in the linking phrase in build phrases. I've been comparing the build settings of the new and old project, but found no luck to solve this.</p>
  
  <p>Does anyone know where I might got it wrong? Thx!</p>
  
  <p>Update: Added the fragment of code of amrFileCodec.h and CJ-Func.m</p>
  
  <p>The amrFileCodec.h</p>
  
  <pre><code>//  amrFileCodec.h
  //  Created by Tang Xiaoping on 9/27/11.
  //  Copyright 2011 test. All rights reserved.
  
  #ifndef amrFileCodec_h
  #define amrFileCodec_h
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdio.h&gt;
  #include "interf_dec.h"
  #include "interf_enc.h"
  
  ...
  
  // 将AMR文件解码成WAVE文件
  int DecodeAMRFileToWAVEFile(const char* pchAMRFileName, const char* pchWAVEFilename);
  
  #endif
  </code></pre>
  
  <p>The CJ-Func.m</p>
  
  <pre><code>//  CJ-Func.m
  //  iBear
  //  Created by Chris Jiang on 11-4-22.
  //  Copyright 2011 Individual. All rights reserved.
  
  #import "CJ-Func.h"
  #import "interf_dec.h"
  #import "interf_enc.h"
  #import "amrFileCodec.h"
  
  @implementation MyPGPlugFunc
  
  ...
  
  - (void)decodeAMR:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
      NSArray *currentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *basePath = [currentPaths objectAtIndex:0];
      NSString *wavDir = [basePath stringByAppendingPathComponent:@"tmp/wav"];
      NSString *wavPath = [basePath stringByAppendingPathComponent:[arguments objectAtIndex:1]];
  
      NSLog(@"[CJ-FUNC] Decoding %@ to %@", [arguments objectAtIndex:0], wavPath);
  
      BOOL isDir = YES;
      NSFileManager *fileMgr = [NSFileManager defaultManager];
      if ( ![fileMgr fileExistsAtPath:wavDir isDirectory:&amp;isDir] ) {
          if ( ![fileMgr createDirectoryAtPath:wavDir withIntermediateDirectories:YES attributes:nil error:nil] )
              NSLog(@"[CJ-FUNC] ERROR: tmp/wav directory creation failed");
          else
              NSLog(@"[CJ-FUNC] tmp/wav directory created");
      }
      [fileMgr release];
  
      int encRes = DecodeAMRFileToWAVEFile(
          [[arguments objectAtIndex:0] cStringUsingEncoding:NSASCIIStringEncoding], 
          [wavPath cStringUsingEncoding:NSASCIIStringEncoding]
      );
  
      if ( encRes &lt;= 0 )
          [self writeJavascript:[NSString stringWithFormat:@"%@();", [arguments objectAtIndex:3]]];
      else
          [self writeJavascript:[NSString stringWithFormat:@"%@('%@');", [arguments objectAtIndex:2], wavPath]];
  }
  
  @end
  </code></pre>