Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7768897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:02:24+00:00 2026-06-01T16:02:24+00:00

I was trying to add AMR-NB decoding support to an iOS app, which has

  • 0

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.

enter image description here

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.

Does anyone know where I might got it wrong? Thx!

Update: Added the fragment of code of amrFileCodec.h and CJ-Func.m

The amrFileCodec.h

//  amrFileCodec.h
//  Created by Tang Xiaoping on 9/27/11.
//  Copyright 2011 test. All rights reserved.

#ifndef amrFileCodec_h
#define amrFileCodec_h
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "interf_dec.h"
#include "interf_enc.h"

...

// 将AMR文件解码成WAVE文件
int DecodeAMRFileToWAVEFile(const char* pchAMRFileName, const char* pchWAVEFilename);

#endif

The CJ-Func.m

//  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:&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 <= 0 )
        [self writeJavascript:[NSString stringWithFormat:@"%@();", [arguments objectAtIndex:3]]];
    else
        [self writeJavascript:[NSString stringWithFormat:@"%@('%@');", [arguments objectAtIndex:2], wavPath]];
}

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:02:26+00:00Added an answer on June 1, 2026 at 4:02 pm

    The message “Undefined symbols for architecture i386” doesn’t mean that your library is missing the i386 architecture. The important part is the next line:

    “_DecodeAMRFileToWaveFile”, referenced from -[MyPGPlugFunc decodeAMR:withDict:] in CJ-Func.o

    It sounds like you have a function DecodeAMRFileToWaveFile(), which is defined in an Obj-C++ .mm file, but you’re trying to use it from a .m file. So you’re running into the difference between the way C compiles functions vs. how C++ does it. You need to tell C++ to make the function look like a plain C function.

    You need this in your header file:

    #ifdef __cplusplus
    extern "C" {
    #endif
    
    void DecodeAMRFileToWaveFile();  // or whatever its declaration is
    
    #ifdef __cplusplus
    }
    #endif
    

    Here’s a reference in the C++ FAQ, and a more detailed explanation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to add email notification to my app in the cleanest way possible. When
Trying to add a class object into a List using reflection, but when invoking
Trying to add a 'class' html attribute, but I think the keyword 'class' is
im trying to add a css class in my javascript code but when i
Just trying to add some text before function's result. onClick=$('#itempriceqty0').clone().appendTo('#itempricewrapper').attr('id', $('#itempricewrapper').children().length-5+1) So I need
I'm trying add a space before a particular string ( Token for example) by
Trying to add django-registration to my app. I have installed setup tools to use
Trying to add Facebook login / registration to a site I'm working on. Been
Trying to add public methods to this slider I purchased but have little knowledge
I am trying add value to a mutlidimensional array but I am slightly confused

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.