Alex Rivera | Logout

How to build ZBar SDK with the project instead of using the static library?

Asked 2012-03-25T13:27:21.703
9

I am building an iOS, code scanner project using ZBar SDK. I am trying to build my project directly from the source of ZBar, rather than including the libzbar.a static library.

I have downloaded the ZBar source which includes the XCode project to build libzbar.a. I tried copying all source files from the project but it didn't work. I keep on getting undefined symbol errors.

What source files should be included, considering that I need to support only iOS?

Should the folder structure be strictly followed to build the project?

Would there be any need of build settings if I direcly include the source files?

EDIT: I followed the same folder structure and build settings used in the XCode project of libzbar. I have managed to build the library but it's still failing while linking. I get the error: ld: duplicate symbol _OBJC_METACLASS for all the source files. I have double checked, there are no references to the original libzbar.a static library in the project or more than one occurrence of these source files. If I remove the references for them, the project builds fine, but then fails whenever any symbol from the library is referenced. I think I am still missing something!!

Edit
Report

1 Answer

0

You should create the static library your self from the source code then add the output static library to your project, or link the projects together and force a build of the static library before your project is build.

After downloading the zip file from the default Mercurial repository and opening the file in xCode, click on the "EmbedReader" part of the target selection drop down box and switch to "zBarSDK"

Once you switch to the zBarSDK, just build from the product menu and you should have your static library file....

answered 2012-03-25T14:51:56.677

Your Answer