简体   繁体   中英

Using C++ library in iOS application

当我尝试调用C ++方法时,屏幕截图是崩溃报告 I've a task in which I need to use a .a c++ library (don't have any idea what is the code in that library) with a header file having some methods declared in it. Now what I need to do is to call these methods from my objective c class. for this I've done following things:

  1. changed the extension of my view controller class from .m to .mm

  2. set my 'other C++ flags' in build settings to objective-c++

all other steps which were suggested at stack overflow and any where else.still I'm not able to use that library. An example will give you all the better understanding on my problem:

suppose We've a library mylibrary.a,We also have a header file named myHeaderFile.h. Now we need to call a method named 'int Login(unsigned long *LoginInfo)' which is declared in myHeaderFile.h header file. What should be done? The screen shot is the crash report when I try to call C++ method

What can be mistake here,please suggest. A quick help will be appreciated...

Attach to the app with any debugger or turn on Error Reporting to see what exactly crashes.

UPD: Apple's LLDB tutorial . You need these steps:

  1. Specifying the Program to Debug
  2. Launching the Program with LLDB ( r , then Enter )

Finally, when it crashes, type bt , then Enter .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM