MonoTouch Binding Project Native linking failed. MT5202 -
MonoTouch Binding Project Native linking failed. MT5202 -
i have next error build output when using library have linked through monotouch linking project.
undefined symbols architecture armv7:
the header file follows (left out eums space)
#import <foundation/foundation.h> #import <audiotoolbox/audiotoolbox.h> #import <audiounit/audiounit.h> #import <externalaccessory/externalaccessory.h> @interface mtscra : nsobject <nsstreamdelegate> { @private nsstring *cardiin; nsstring *carddata; nsstring *cardlast4; nsstring *cardname; nsstring *cardexpdate; nsstring *cardservicecode; nsstring *cardstatus; nsstring *responsedata; nsstring *maskedtracks; nsstring *stdtrack1; nsstring *stdtrack2; nsstring *stdtrack3; nsstring *encryptedtrack1; nsstring *encryptedtrack2; nsstring *encryptedtrack3; nsstring *encryptionstatus; nsstring *maskedtrack1; nsstring *maskedtrack2; nsstring *maskedtrack3; nsstring *trackdecodestatus; nsstring *encryptedmagneprint; nsstring *magneprintstatus; nsstring *deviceserialnumber; nsstring *deviceserialnumbermagtek; nsstring *encrypedsessionid; nsstring *deviceksn; nsstring *devicefirmware; nsstring *devicename; nsstring *devicecaps; nsstring *devicestatus; nsstring *tlvversion; nsstring *devicepartnumber; nsstring *capmsr; nsstring *captracks; nsstring *capmagstripeencryption; nsstring *maskedpan; nsstring *additionalinfotrack1; nsstring *additionalinfotrack2; nsstring *responsetype; nsstring *batterylevel; nsstring *swipecount; //nsarray *arycarddata; //nsarray *arymaskedtracks; audiounit riounit; aurendercallbackstruct inputproc; audiostreambasicdescription thruformat; audiobufferlist bufferlist; audiobuffer buf; audiobuffer buf1; bool isdeviceconnected; long eventmask; long devcapabilities; byte *commandbits; int commandbitsindex; eaaccessory * _accessory; easession * _session; eaaccessorymanager *eaaccessory; nsmutablestring *datafromidynamo; nsmutablestring *deviceprotocolstring; nsmutablestring *configparams; enum mtscradevicetype devtype; @public } //initialize device -(bool) opendevice; //close device -(bool) closedevice; //retrieves if device connected - (bool) isdeviceconnected; //retrieve masked track1 if - (nsstring *) gettrack1masked; //retrieve masked track2 if - (nsstring *) gettrack2masked; //retrieve masked track3 if - (nsstring *) gettrack3masked; //retrieves existing stored masked data, supported idynamo, homecoming empty string in sound reader - (nsstring *) getmaskedtracks; //retrieve encrypted track1 if - (nsstring *) gettrack1; //retrieve encrypted track2 if - (nsstring *) gettrack2; //retrieve encrypted track3 if - (nsstring *) gettrack3; //retrieve encrypted magneprint, supported idynamo, homecoming empty string in sound reader - (nsstring *) getmagneprint; //retrieve magneprint status, supported idynamo, homecoming empty string in sound reader - (nsstring *) getmagneprintstatus; //retrieve device serial number - (nsstring *) getdeviceserial; //retrieve device serial number created magtek - (nsstring *) getmagtekdeviceserial; //retrieve firmware vsersion number - (nsstring *) getfirmware; //retrieve device name - (nsstring *) getdevicename; //retrieve device capabilities - (nsstring *) getdevicecaps; //retrieve device status - (nsstring *) getdevicestatus; //retrieve tlv version - (nsstring *) gettlvversion; //retrieve device part number - (nsstring *) getdevicepartnumber; //retrieve key serial number - (nsstring *) getksn; //retrieve individual tag value, supported in sound reader - (nsstring *) gettagvalue: (uint32)tag; //retrieve msr capability - (nsstring *) getcapmsr; //retrieve tracks capability - (nsstring *) getcaptracks; //retrieve magstripe encryption capability - (nsstring *) getcapmagstripeencryption; //send commands device - (void) sendcommandtodevice:(nsstring *)pdata; //sets protocol string idynamo - (void) setdeviceprotocolstring:(nsstring *)pdata; //sets config params sdk - (void) setconfigurationparams:(nsstring *)pdata; //setup events hear - (void) listenforevents:(uint32)event; //retrieves device type - (int) getdevicetype; //retrieves length of teh pan - (int) getcardpanlength; //retrieve session id, supported idynamo, homecoming empty string in sound reader - (nsstring *) getsessionid; //retrieved whole response reader - (nsstring *) getresponsedata; //retrieves name in card - (nsstring *) getcardname; //retrieves iin in card - (nsstring *) getcardiin; //retrieves lastly 4 of pan - (nsstring *) getcardlast4; //retrieves expiration date - (nsstring *) getcardexpdate; //retrieves service code - (nsstring *) getcardservicecode; //retrieves card status - (nsstring *) getcardstatus; //retrieves track decode status - (nsstring *) gettrackdecodestatus; //retrieve response type - (nsstring *) getresponsetype; //sets type of device open -(void) setdevicetype: (uint32)devicetype; //retrieves device opened status - (bool) isdeviceopened; // clears buffer stored during card swipe or command response - (void) clearbuffers; //retrieves battery level - (long) getbatterylevel; //retrieves swipe count - (long) getswipecount; //gets current version of sdk. - (nsstring *) getsdkversion; //retrieves operation status - (nsstring *) getoperationstatus; //config functions - (nsstring *) getencryptionstatus; //config functions @end
my apidefinition looks this
using system; using system.drawing; using monotouch.objcruntime; using monotouch.foundation; using monotouch.audiotoolbox; using monotouch.externalaccessory; using monotouch.uikit; namespace creditcardreaderidynamodll { [basetype(typeof(nsobject))] [model] interface nsstreamdelegate { } [basetype(typeof(nsobject),delegates=new string[]{"weakdelegate"},events = new type[] {(typeof(nsstreamdelegate))})] interface miscra{ [export("delegate"), nullallowed] nsobject weakdelegate{get; set;} [wrap("weakdelegate")][new] nsstreamdelegate delegate{get; set;} [exportattribute("cardiin")] nsstring cardiin{[bind("cardiin")]get; set;} [exportattribute("carddata")] nsstring carddata{[bind("carddata")]get; set;} [exportattribute("cardlast4")] nsstring cardlast4{[bind("cardlast4")]get; set;} [exportattribute("cardname")] nsstring cardname{[bind("cardname")]get; set;} [exportattribute("cardexpdate")] nsstring cardexpdate{[bind("cardexpdate")]get; set;} [exportattribute("cardservicecode")] nsstring cardservicecode{[bind("cardservicecode")]get; set;} [exportattribute("cardstatus")] nsstring cardstatus{[bind("cardstatus")]get; set;} [exportattribute("responsedata")] nsstring responsedata{[bind("responsedata")]get; set;} [exportattribute("maskedtracks")] nsstring maskedtracks{[bind("maskedtracks")]get; set;} [exportattribute("stdtrack1")] nsstring stdtrack1{[bind("stdtrack1")]get; set;} [exportattribute("stdtrack2")] nsstring stdtrack2{[bind("stdtrack2")]get; set;} [exportattribute("stdtrack3")] nsstring stdtrack3{[bind("stdtrack3")]get; set;} [exportattribute("encryptedtrack1")] nsstring encryptedtrack1{[bind("encryptedtrack1")]get; set;} [exportattribute("encryptedtrack2")] nsstring encryptedtrack2{[bind("encryptedtrack2")]get; set;} [exportattribute("encryptedtrack3")] nsstring encryptedtrack3{[bind("encryptedtrack3")]get; set;} [exportattribute("encryptionstatus")] nsstring encryptionstatus{[bind("encryptionstatus")]get; set;} [exportattribute("maskedtrack1")] nsstring maskedtrack1{[bind("maskedtrack1")]get; set;} [exportattribute("maskedtrack2")] nsstring maskedtrack2{[bind("maskedtrack2")]get; set;} [exportattribute("maskedtrack3")] nsstring maskedtrack3{[bind("maskedtrack3")]get; set;} [exportattribute("trackdecodestatus")] nsstring trackdecodestatus{[bind("trackdecodestatus")]get; set;} [exportattribute("encryptedmagneprint")] nsstring encryptedmagneprint{[bind("encryptedmagneprint")]get; set;} [exportattribute("magneprintstatus")] nsstring magneprintstatus{[bind("magneprintstatus")]get; set;} [exportattribute("deviceserialnumber")] nsstring deviceserialnumber{[bind("deviceserialnumber")]get; set;} [exportattribute("deviceserialnumbermagtek")] nsstring deviceserialnumbermagtek{[bind("deviceserialnumbermagtek")]get; set;} [exportattribute("encrypedsessionid")] nsstring encrypedsessionid{[bind("encrypedsessionid")]get; set;} [exportattribute("deviceksn")] nsstring deviceksn{[bind("deviceksn")]get; set;} [exportattribute("devicefirmware")] nsstring devicefirmware{[bind("devicefirmware")]get; set;} [exportattribute("devicename")] nsstring devicename{[bind("devicename")]get; set;} [exportattribute("devicecaps")] nsstring devicecaps{[bind("devicecaps")]get; set;} [exportattribute("devicestatus")] nsstring devicestatus{[bind("devicestatus")]get; set;} [exportattribute("tlvversion")] nsstring tlvversion{[bind("tlvversion")]get; set;} [exportattribute("devicepartnumber")] nsstring devicepartnumber{[bind("devicepartnumber")]get; set;} [exportattribute("capmsr")] nsstring capmsr{[bind("capmsr")]get; set;} [exportattribute("captracks")] nsstring captracks{[bind("captracks")]get; set;} [exportattribute("capmagstripeencryption")] nsstring capmagstripeencryption{[bind("capmagstripeencryption")]get; set;} [exportattribute("maskedpan")] nsstring maskedpan{[bind("maskedpan")]get; set;} [exportattribute("additionalinfotrack1")] nsstring additionalinfotrack1{[bind("additionalinfotrack1")]get; set;} [exportattribute("additionalinfotrack2")] nsstring additionalinfotrack2{[bind("additionalinfotrack2")]get; set;} [exportattribute("responsetype")] nsstring responsetype{[bind("responsetype")]get; set;} [exportattribute("batterylevel")] nsstring batterylevel{[bind("batterylevel")]get; set;} [exportattribute("swipecount")] nsstring swipecount{[bind("swipecount")]get; set;} /* [exportattribute("riounit")] audiounit riounit{[bind("riounit")]get; set;} [exportattribute("inputproc")] aurendercallbackstruct inputproc{ [bind("inputproc")]get; set; }*/ [exportattribute("thruformat")] audiostreambasicdescription thruformat{[bind("thruformat")]get; set;} [exportattribute("bufferlist")] audiobuffer bufferlist{[bind("bufferlist")]get; set;} [exportattribute("buf")] audiobuffer buf{[bind("buf")]get; set;} [exportattribute("buf1")] audiobuffer buf1{[bind("buf1")]get; set;} [exportattribute("isdeviceconnected")] bool isdeviceconnected{ [bind("isdeviceconnected")]get; set; } [exportattribute("eventmask")] long eventmask{[bind("eventmask")]get; set;} [exportattribute("devcapabilities")] long devcapabilities{ [bind("devcapabilities")]get; set; } [exportattribute("commandbits")] byte commandbits{ [bind("commandbits")]get; set; } [exportattribute("commandbitsindex")] int commandbitsindex{ [bind("commandbitsindex")]get; set; } [exportattribute("_accessory")] eaaccessory _accessory{ [bind("_accessory")]get; set; } [exportattribute("_session")] easession _session{ [bind("_session")]get; set; } [exportattribute("eaaccessory")] eaaccessorymanager eaaccessory{ [bind("eaaccessory")]get; set; } [exportattribute("datafromidynamo")] nsmutableattributedstring datafromidynamo{ [bind("datafromidynamo")]get; set; } [exportattribute("deviceprotocolstring")] nsmutableattributedstring deviceprotocolstring{ [bind("deviceprotocolstring")]get; set; } [exportattribute("configparams")] nsmutableattributedstring configparams{ [bind("configparams")]get; set; } [export ("opendevice")] bool opendevice(); [export ("closedevice")] bool closedevice(); [export ("isdeviceconnected")] bool issdeviceconnected(); [export ("gettrack1masked")] nsstring gettrack1masked(); [export ("gettrack2masked")] nsstring gettrack2masked(); [export ("gettrack3masked")] nsstring gettrack3masked(); [export ("getmaskedtracks")] nsstring getmaskedtracks(); [export ("gettrack1")] nsstring gettrack1(); [export ("gettrack2")] nsstring gettrack2(); [export ("gettrack3")] nsstring gettrack3(); [export ("getmagneprint")] nsstring getmagneprint(); [export ("getmagneprintstatus")] nsstring getmagneprintstatus(); [export ("getdeviceserial")] nsstring getdeviceserial(); [export ("getmagtekdeviceserial")] nsstring getmagtekdeviceserial(); [export ("getfirmware")] nsstring getfirmware(); [export ("getdevicename")] nsstring getdevicename(); [export ("getdevicecaps")] nsstring getdevicecaps(); [export ("getdevicestatus")] nsstring getdevicestatus(); [export ("gettlvversion")] nsstring gettlvversion(); [export ("getdevicepartnumber")] nsstring getdevicepartnumber(); [export ("getksn")] nsstring getksn(); [export ("gettagvalue:")] nsstring settagvalue(uint32 tag); [export ("getcapmsr")] nsstring getcapmsr(); [export ("getcaptracks")] nsstring getcaptracks(); [export ("getcapmagstripeencryption")] nsstring getcapmagstripeencryption(); [export ("sendcommandtodevice:")] void sendcommandtodevice(nsstring pdata); [export ("setdeviceprotocolstring:")] void setdeviceprotocolstring(nsstring pdata); [export ("setconfigurationparams:")] void setconfigurationparams(nsstring pdata); [export ("listenforevents:")] void listenforevents(uint32 _event); [export ("getdevicetype")] int getdevicetype(); [export ("getcardpanlength")] int getcardpanlength(); [export ("getsessionid:")] nsstring getsessionid(); [export ("getresponsedata")] nsstring getresponsedata(); [export ("getcardname")] nsstring getcardname(); [export ("getcardiin")] nsstring getcardiin(); [export ("getcardlast4")] nsstring getcardlast4(); [export ("getcardexpdate")] nsstring getcardexpdate(); [export ("getcardservicecode")] nsstring getcardservicecode(); [export ("getcardstatus")] nsstring getcardstatus(); [export ("gettrackdecodestatus")] nsstring gettrackdecodestatus(); [export ("getresponsetype")] nsstring getresponsetype(); [export ("setdevicetype:")] void setdevicetype(uint32 devicetype); [export ("isdeviceopened")] bool isdeviceopened(); [export ("clearbuffers")] void clearbuffers(); [export ("getbatterylevel")] long getbatterylevel(); [export ("getswipecount")] long getswipecount(); [export ("getsdkversion")] nsstring getsdkversion(); [export ("getoperationstatus")] nsstring getoperationstatus(); [export ("getencryptionstatus")] nsstring getencryptionstatus(); } }
and lastly linkwith file follows
using system; using monotouch.objcruntime; [assembly: linkwith ("libmtscra.a", linktarget = linktarget.armv7 | linktarget.armv6 | linktarget.simulator, frameworks = "audiotoolbox externalaccessory foundation", forceload = true)]
when import library in a normal monotouch ipad project next build output. (not ful output, ran out of characters)
compiling native code\ /var/folders/g2/j4prljqd2w58pfd2bf0hm9pc0000gn/t/tmp7967f93f.tmp/system.core.dll.armv7.o /var/folders/g2/j4prljqd2w58pfd2bf0hm9pc0000gn/t/tmp7967f93f.tmp/monotouch.dialog-1.dll.armv7.o /var/folders/g2/j4prljqd2w58pfd2bf0hm9pc0000gn/t/tmp7967f93f.tmp/mscorlib.dll.armv7.o /var/folders/g2/j4prljqd2w58pfd2bf0hm9pc0000gn/t/tmp7967f93f.tmp/system.dll.armv7.o /var/folders/g2/j4prljqd2w58pfd2bf0hm9pc0000gn/t/tmp7967f93f.tmp/monotouch.dll.armv7.o /users/dylanvdmerwe/desktop/projects/affinion/trunk/creditcardreaderidynamoipaddemo/creditcardreaderidynamoipaddemo/obj/release/mtouch-cache/main..armv7.cache.v7wueg1cyibzgqyrjadxq2i83lq=.o /users/dylanvdmerwe/desktop/projects/affinion/trunk/creditcardreaderidynamoipaddemo/creditcardreaderidynamoipaddemo/obj/release/mtouch-cache/registrar.armv7.cache.oz4clqsh9mr1-cuvc2ochfskn8a=.o -o /var/folders/g2/j4prljqd2w58pfd2bf0hm9pc0000gn/t/tmp7967f93f.tmp/creditcardreaderidynamoipaddemo -framework cfnetwork -framework foundation -framework uikit -framework audiotoolbox -framework quartzcore -framework coregraphics -framework externalaccessory -lz -liconv -u _mono_pmip -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -u _monotouch_intptr_objc_msgsend_intptr -u _monotouch_intptr_objc_msgsendsuper_intptr -u _closezstream -u _createzstream -u _flush -u _readzstream -u _writezstream -lmono-2.0 -lmonotouch -l/developer/monotouch/sdks/monotouch.iphoneos.sdk/usr/lib -force_load /var/folders/g2/j4prljqd2w58pfd2bf0hm9pc0000gn/t/tmp7967f93f.tmp/libmtscra.a\ undefined symbols architecture armv7:\ "operator delete(void*)", referenced from:\ -[mtscra hexstringtobytes:] in libmtscra.a(mtscra.o)\ hasdata(void*, unsigned long*, audiotimestamp const*, unsigned long, unsigned long, audiobufferlist*)in libmtscra.a(mtscra.o)\ composecommand(int, long*, int, unsigned char*, int, int*)in libmtscra.a(mtscra.o)\ audioreader::processsamples(long) in libmtscra.a(audioreader.o)\ audioreader::copyresponsedata() in libmtscra.a(audioreader.o)\ audioreader::initdata() in libmtscra.a(audioreader.o)\ audioreader::tlvdecode(int*) in libmtscra.a(audioreader.o)\ ...\ "operator new[](unsigned long)", referenced from:\ -[mtscra hexstringtobytes:] in libmtscra.a(mtscra.o)\ hasdata(void*, unsigned long*, audiotimestamp const*, unsigned long, unsigned long, audiobufferlist*)in libmtscra.a(mtscra.o)\ composecommand(int, long*, int, unsigned char*, int, int*)in libmtscra.a(mtscra.o)\ audioreader::copyresponsedata() in libmtscra.a(audioreader.o)\ audioreader::manchesterdecodeuartforresponsedata(int, unsigned char*)in libmtscra.a(audioreader.o)\ audioreader::bytearraytohex(unsigned char*, int)in libmtscra.a(audioreader.o)\ audioreader::manchesterdecodeuart(int, int*)in libmtscra.a(audioreader.o)\ ...\ "operator new(unsigned long)", referenced from:\ audioreader::processsamples(long) in libmtscra.a(audioreader.o)\ audioreader::processsamples(long) in libmtscra.a(audioreader.o)\ "___cxa_begin_catch", referenced from:\ -[mtscra getconfigurationparams:] in libmtscra.a(mtscra.o)\ -[mtscra setcarddata:] in libmtscra.a(mtscra.o)\ -[mtscra getcardiinfrommasktracks] in libmtscra.a(mtscra.o)\ -[mtscra getcardlast4frommasktracks] in libmtscra.a(mtscra.o)\ -[mtscra getmaskedpan] in libmtscra.a(mtscra.o)\ -[mtscra gettrack1additionalinfo] in libmtscra.a(mtscra.o)\ -[mtscra gettrack2additionalinfo] in libmtscra.a(mtscra.o)\ ...\ "___cxa_end_catch", referenced from:\ -[mtscra getconfigurationparams:] in libmtscra.a(mtscra.o)\ -[mtscra setcarddata:] in libmtscra.a(mtscra.o)\ -[mtscra getcardiinfrommasktracks] in libmtscra.a(mtscra.o)\ -[mtscra getcardlast4frommasktracks] in libmtscra.a(mtscra.o)\ -[mtscra getmaskedpan] in libmtscra.a(mtscra.o)\ -[mtscra gettrack1additionalinfo] in libmtscra.a(mtscra.o)\ -[mtscra gettrack2additionalinfo] in libmtscra.a(mtscra.o)\ ...\ "___gxx_personality_sj0", referenced from:\ audioreader::processsamples(long) in libmtscra.a(audioreader.o)\ audioreader::processsamples(long) in libmtscra.a(audioreader.o)\ audioreader::processsamples(long) in libmtscra.a(audioreader.o)\ audioreader::processsamples(long) in libmtscra.a(audioreader.o)\ ld: symbol(s) not found architecture armv7\ collect2: ld returned 1 exit status\ \ error mt5202: native linking failed. please review build log.\ \ ---------------------- done ----------------------\ \ build: 1 error, 4 warnings\
i have tried adding audiounit in linkwith file , framework not found error. have tried adding coreaudio same effect.
sorry code dump. hope can help me out there, stuck in hole @ moment.
as missing references new() tend indicate, you're binding c++ library (or wrapper c++ lib).
it library depend on (c++) other one, add together [linkwith] attribute 1
and maintain in mind c++ library should have property iscxx=true set in linkwith attribute
[assembly: linkwith ("libmtscra.a", iscxx=true, linktarget = linktarget.armv7 | linktarget.armv6 | linktarget.simulator, frameworks = "audiotoolbox externalaccessory foundation", forceload = true)]
binding monotouch
Comments
Post a Comment