2
votes

I have created a static library for tesseract which has method that accept UIImage as input and process the image and return the text. I have also created a wrapper for the static library in MonoTouch.

On implementing the dll in a monotouch project on building the solution the application throws the build error /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -gdwarf-2 -miphoneos-version-min=5.0 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/System.dll.7.o /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/TesseractWrapper.dll.7.o /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/testOCRApp.exe.7.o /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/mscorlib.dll.7.o /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/System.Core.dll.7.o /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/monotouch.dll.7.o /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/registrar.7.o /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/main.7.o -o /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/testOCRApp -framework CFNetwork -framework Foundation -framework UIKit -framework AudioToolbox -lz -u _mono_pmip -u _CreateZStream -u _CloseZStream -u _Flush -u _ReadZStream -u _WriteZStream -liconv -lmono-2.0 -lmonotouch -L/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/lib -force_load /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/libTesseractStaticLib.a ld: duplicate symbol _main in /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/main.7.o and /var/folders/96/96OqndqqHICBMOsx0EQOFU+++TM/-Tmp-/tmp1cdf0f88.tmp/libTesseractStaticLib.a(svpaint.o) for architecture armv7 collect2: ld returned 1 exit status

I don't know how to proceed.Please help

1
My tesseract static library does not have any main function.When I tried the static library with xcode the project successfully build and with monotouch this id:duplicate symbol_main arisesrividya
when I add other linker flag and C++ standard library to "-lstdc++" in xcode it was fine for me. but I don't where to add these settings in monotouch.Kindly help mesrividya

1 Answers

1
votes

ld: duplicate symbol _main

Only the MonoTouch main application should be exporting a main function.

The error message tells you that this function also exists inside your static library. Try removing it (or comment it out) and re-built the static library.