Sunday, 15 September 2013

objective c - How to solve ld: symbol(s) not found for architecture armv7 when use the extra C-library in IOS-Xcode 6? -



objective c - How to solve ld: symbol(s) not found for architecture armv7 when use the extra C-library in IOS-Xcode 6? -

i new ios , trying utilize c-library in x-code 6 in ios. have add together library xcode 6 next picture.

the libtest.a library , test.h header file of libtest.a.

it has link libary in buuld phases. , has c sample code how utilize next code

#include <stdio.h> #include "lib/test.h" int main(int argc, char* argv[]) { test("234.235.236.237"); printf("done.\n"); homecoming 0; }

it seems phone call test function , give value "234.235.236.237".

but how phone call test funtion in viewcontroler.m.

how phone call library function in viewcontroler.m. ?

---------------------------edit---------------------------

i can phone call test function in viewcontroler.m next code.

#import "viewcontroller.h" #import "test.h" @interface viewcontroller () @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; test("234.235.236.237"); }

but compile fail , has 2 error , log following:

ld: warning: ignoring file /users/apk/desktop/libtest/libtest.a, file built archive not architecture beingness linked (armv7): /users/apk/desktop/libtest/libtest.a undefined symbols architecture armv7: "_test", referenced from: -[viewcontroller viewdidload] in viewcontroller.o ld: symbol(s) not found architecture armv7 clang: error: linker command failed exit code 1 (use -v see invocation)

i seek delete armv7 in build setting , , error happened 1 time again @ armv64.

i have no idea...how solve ?

sorry english language , in advance.

import header #import "test.h"

call c functions functionname(param1, param2, etc.) sytax, , objc usually.

ios objective-c xcode static-libraries

No comments:

Post a Comment