MBProgressHUD armv7 error
Asked Answered
C

4

15

i'm trying to use MBProgressHUD. i added header an .m to project, imported header in class and call MBProgressHUD from an ibaction in this way:

-(IBAction)submitForm:(id)sender{
    MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:self.view];
    [self.view addSubview:HUD];
    HUD.labelText = @"Connecting";
    [HUD show:YES];
}

when i build project it happens an error:

Undefined symbols for architecture armv7:
    "_OBJC_CLASS_$_MBProgressHUD", referenced from:
    objc-class-ref in FormViewController.o
    ld: symbol(s) not found for architecture armv7
    collect2: ld returned 1 exit status

How can i fix it? can you help me?

Cruciferous answered 13/1, 2012 at 14:43 Comment(2)
Looks like you are missing the arm7 architecture for your library. Did you compile the source code of MBProgressHUD framework yourself or did you download the .framework or static .a files without building it yourself?Abound
i've downloaded .h e .m from github.com/jdg/MBProgressHUDCruciferous
A
65

In your Xcode project, select your MBProgressHUD.m file in the list of files (along the left edge of the workspace) and look at the File Inspector for that file.

Make sure the checkbox is ON for your project in the "Target Membership" setting.

Make sure Target Membership is selected for your .m file

Abound answered 13/1, 2012 at 15:26 Comment(1)
For me this checkbox was greyed out. I deleted files, and re-added them. This checkbox appears on the "add files" screen and is not greyed out there...solved my issue. thx!Ingram
N
5

Just a guess, but check to make sure that MBProgressHUD.m is added to your Build Sources build phase.

Nicknickel answered 13/1, 2012 at 15:28 Comment(1)
+1 yes adding MBProgressHUD.m there only thing that worked for me, thx!Naldo
L
2

This is weird error with XCode import, Delete MBProgressHUD (Reference ONLY) then add back to XCode.

if it doesn't work Few Extra steps.
1. Delete MBProgressHUD (Reference ONLY).
2. Comment the code related to MBProgressHUD.
3. Build.
4. Add MBProgressHUD to XCode.
5. Uncomment code.
6. Build.

Lallage answered 13/1, 2012 at 15:25 Comment(0)
P
0

try to add CoreGraphics.framework

Pandybat answered 30/1, 2012 at 10:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.