开发者

Problem in adding static library in cocoa application

开发者 https://www.devze.com 2022-12-20 12:32 出处:网络
I am having liavcodec.a static library and header files of this library. libavcodec.a I added this library and their header files into my project and there is no error. I can see this library added

I am having liavcodec.a static library and header files of this library.

libavcodec.a

I added this library and their header files into my project and there is no error. I can see this library added in Target->Info->General and i have edited the Header Search Path also.

I can add header file #import “avcodec.h” into xcode project also. I can use all the variables which have b开发者_如何学Ceen declared in structure of that file. But i am trying to use any function from that class, i am getting some errors like,

Test.m
—-
“-avcodec_register_all”, referenced from:
-[Test initialize] in Test.o
Symbol(s) not found
collect2: id returned 1 exit status
—-

Do you what is the problem?

Many thanks.


Provide implementation of your [test initialize] method. Also provide the configuration command which you used to build the static library.

Try rebuilding the library, the method avcodec_register_all should be directly accessible through allcodecs.c file if the library is included in target and header search path is properly configured. Probably the library is corrupt, just as tedge says.


Just as a sanity check, verify that your library file contains the expected symbols; Type this in a terminal window (replacing path/to with the correct path):

nm -g /path/to/libavcodec.a | grep avcodec_register_all

(If the command's output is just a blank line, then the library file is probably corrupt).

0

精彩评论

暂无评论...
验证码 换一张
取 消