2

I have been trying to bind a lib called Scandit used for scanning barcodes from images.

So far I have been unsuccessful. The Library says it supports armv6 arm7 and i386. but I cannot get it to build.

lipo -info libscanditsdk-iphone-2.1.17.a
Architectures in the fat file: libscanditsdk-iphone-2.1.17.a are: armv6 armv7 i386

here is my build output

https://gist.github.com/4ee195063b61ae292ea3

Here is what my LinkWith file looks like

using System;
using MonoTouch.ObjCRuntime;

[assembly: LinkWith ("libmeScanditWrapper.a", LinkTarget.ArmV7 | LinkTarget.ArmV6
                     ,ForceLoad = true, IsCxx=true
                     ,Frameworks="CoreVideo CoreGraphics AudioToolbox AVFoundation CoreMedia QuartzCore SystemConfiguration"
                     ,LinkerFlags="-lz -liconv -lstdc++"
                     )]

I am able to use the library natively on my device using the sample project they provided but I cannot get it to compile at all. using LinkTarget.ArmV6. If I remove this and just leave LinkTarget.ArmV7 then it wil compile but it won't work none of the bound functions will work even in a simple test lib i made.

Correct me if i am wrong these means my phone requires armv6?

thats why i can get sample libs to work using armv6.

if this is the case I need to know if anyone has any ideas why it won't build with armv6 support when it seems the lib supports it.

poupou
  • 43,413
  • 6
  • 77
  • 174
Nathan
  • 153
  • 1
  • 8

1 Answers1

0

Correct me if i am wrong these means my phone requires armv6?

Newer iPhones uses armv7 but can execute armv6 code.

Assertion failed: (_mode == modeFinalAddress), function finalAddress, file /SourceCache/ld64/ld64-127.2/src/ld/ld.hpp, line 588.
0  0x100011c51  __assert_rtn + 81
1  0x10008d45c  ld::tool::OutputFile::addressOf(ld::Internal const&, ld::Fixup const*, ld::Atom const**) + 172
2  0x10008f361  ld::tool::OutputFile::applyFixUps(ld::Internal&, unsigned long long, ld::Atom const*, unsigned char*) + 369
3  0x10008c3b7  ld::tool::OutputFile::writeOutputFile(ld::Internal&) + 807
4  0x100085079  ld::tool::OutputFile::write(ld::Internal&) + 153
5  0x1000121ab  main + 1147
collect2: ld returned 1 exit status

That's Apple's provided linker crashing. That's uncommon and likely means it's being fed something corrupted.

You're showing the output of lipo on libscanditsdk-iphone-2.1.17.a but you're using [LinkWith] on libmeScanditWrapper.a. What happened between the two ?

poupou
  • 43,413
  • 6
  • 77
  • 174
  • sorry thats a copy and paste error i at one point tried to just wrap scandit in my own lib the both used the same linkwith flags. tho right after i posted this i notice scandit had a version 2.2 that dosen't seem to have this issue. – Nathan Jul 24 '12 at 21:12