0

I am trying to use AppList by rpetrich to display applications' list dynamically. But I am getting following error while compiling;

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_ALApplicationList", referenced from:
      objc-class-ref in Settings.mm.9ffba1be.o
ld: symbol(s) not found for architecture armv7

I think I have placed all required header files and library at correct place as mentioned in the link i.e. Header files in theos include folder and libapplist.dylib in theos' lib folder. Here is my makefile:

MakeFile:

include theos/makefiles/common.mk

BUNDLE_NAME = Settings
Settings_FILES = Settings.mm
Settings_INSTALL_PATH = /Library/PreferenceBundles
Settings_FRAMEWORKS = UIKit
Settings_PRIVATE_FRAMEWORKS = Preferences
Settings_LIBRARIES = applist
Settings_LDFLAGS = -lapplist

include $(THEOS_MAKE_PATH)/bundle.mk

internal-stage::
    $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
    $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/Settings.plist$(ECHO_END)

Settings.mm

#import <Preferences/Preferences.h>
#import <UIKit/UIKit.h>
#import <AppList/ALApplicationList.h> //no error here. compiles fine

@interface SettingsListController: PSListController {
}
@end

@implementation SettingsListController
- (id)specifiers {
    if(_specifiers == nil) {
        _specifiers = [[self loadSpecifiersFromPlistName:@"Settings" target:self] retain];
    }
    return _specifiers;
}
@end

@interface ApplicationsList : PSListController
{
    BOOL found;
}

@end

@implementation ApplicationsList

- (id)specifiers {
    if(_specifiers == nil) {


        NSMutableArray *__specifiers = [[[NSMutableArray alloc]init] retain];

           ALApplicationList *apps = [ALApplicationList sharedApplicationList]; //list all the apps

         NSArray *displayIdentifiers = [[apps.applications allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
         return [[apps.applications objectForKey:obj1] caseInsensitiveCompare:[apps.applications objectForKey:obj2]];}]; //sort the apps by display name
        // [displayIdentifiers retain]; //make sure it doesn't disappear when you actually need to use it, if you only use it once, release it

        if(displayIdentifiers.count > 0)
        {
            UIAlertView *myAlert = [[UIAlertView alloc]initWithTitle:@"title" message:@"Wow!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [myAlert show];
            [myAlert release];

        }
        for (int i = 0; i < displayIdentifiers.count; i++) {
            PSSpecifier* specifier = [PSSpecifier preferenceSpecifierNamed:[displayIdentifiers objectAtIndex:i]
                                                                    target:self
                                                                       set:NULL
                                                                       get:NULL
                                                                    detail:Nil
                                                                      cell:PSSwitchCell
                                                                      edit:Nil];


            [specifier setProperty:bundle forKey:@"lazy-bundle"];
            specifier->action = @selector(lazyLoadBundle:);
            [__specifiers addObject:specifier];
            }
            [specifier release];
        }
        _specifiers = [NSArray arrayWithArray:__specifiers];

    }
    return _specifiers;
}

@end

Please tell me what am I missing? I am really unable to figure out this issue. Thanks alot.

NightFury
  • 13,436
  • 6
  • 71
  • 120

0 Answers0