cancel
Showing results for 
Search instead for 
Did you mean: 

iOS SMP3.0 SP05 Odata Offline Store Linker errors

Former Member
0 Kudos

Hi, i just recently started developing with the SMP3.0 Native SDK SP05 and i got the Online Store to work.

My Problem regards the Offline Store:

As soon as i include the Offline Store Library (libOdataOffline.a) i get the strangest Linker errors (see Attachment). As soon as i remove the Library again everything works fine.

My guess would be the library is compiled with another c-compiler or something like that.

I am Working on the latest XCode (6.1), the latest iOS (8.1) and the latest Patch level of the SDK (PL 3).

thanks in advance, Matthias

Accepted Solutions (1)

Accepted Solutions (1)

former_member190800
Contributor
0 Kudos

did you resolve this issue?  If not, can you provide a screenshot of your Build Settings for the following:

OTHER_LINKER_FLAGS

HEADER_SEARCH_PATHS

LIBRARY_SEARCH_PATHS

?

Former Member
0 Kudos

Hi ,

thanks for the reply, unfortunately i have been out of office the last days. No i haven't resolved the issues.

In the Attachments you'll find a screenshot with the Flags you mentioned.

Thanks in advance for your help.

former_member190800
Contributor
0 Kudos

HI , why do you have the stdlib=libstdc++ linker flag set?

Typically, I would link the stdc++ library in the Target > General > Linked Frameworks and Libraries section.  See screenshot below.

This results in a linker flag being inherited as:  -lstdc++.6.0.9, -lstdc++.6 or similar.

Former Member
0 Kudos

Hi ,

this seemed to work. The Problem was the tutorial i followed (http://help.sap.com/saphelp_smp305sdk/helpdata/en/a9/200893bf404b3ea001d04457bbfecd/content.htm?fram...) said i need libstdc++.dylib, now i added -libstdc++.6.0.9 and it seems to work.

The only problem now are the following errors:

Undefined symbols for architecture armv7:

  "_OBJC_CLASS_$_SODataOfflineStoreOptions", referenced from:

      objc-class-ref in MyLogonHandler.o

  "_OBJC_CLASS_$_SODataOfflineStore", referenced from:

      objc-class-ref in MyLogonHandler.o

ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

note that all header files and librarys are in place :S

former_member190800
Contributor
0 Kudos

can you post a screenshot of this error?  Is it for certain in your main app target, or in the tests? 

Also, what is your xCode & iOS version?

--Stan

Former Member
0 Kudos


I am Working on the latest XCode (6.1), the latest iOS (8.1) and the latest Patch level of the SDK (PL 3).


The search paths are set correctly in the main target (see screenshot)


Errors are also provided in the screenshot


UPDATE: also tried XCode 5.1, same problem

former_member190800
Contributor
0 Kudos

HI good news!  If you look in detail on the left side of the screen in the errors.png screenshot, you'll see that the three errors occur under the smpTestPleaseWorkTests target, not the smpTestPleaseWork target.  So it is an easy fix.

xCode treats Build Settings for each target in a project separately--at least, that has been our finding with xCode 6.  So, the resolution is to copy the Header Search Paths (not sure if Library Search Paths & linker flags are required) to the Build Settings for the "Tests" target.

See screenshot that I shared with colleague on the same topic. 

This should definitely resolve the error. 

One tool that I would recommend investigating if you will be spending more time with several SAP Mobile SDK projects is Cocoapods.  Cocoapods is really the best Cocoa dependency management system in the community, and I've published some instruction guides for using it with the SDK here: 

Former Member
0 Kudos

Hi ,

i tried your approach (see screenshot) but unfortunately no change, i still get the same errors. I also added the Headers to the Build Phases, added the linker flags and search paths.

After I added the linker flags i got some other errors which resolved when i added the frameworks to smpTestPleaseWorkTests.

Still the same errors.

Former Member
0 Kudos

Hi

I just switched to using CocoaPods and it worked like a Charm.

Thank you very much for your help

former_member190800
Contributor
0 Kudos

glad to hear it.  If it's working, I'd keep going with this path.  I've been using Cocoapods for over a year now, with great productivity, and I now use it 100% of the time when working with the SAP SDK. 

The next thing I would have checked is if you had "linked the binary with the libraries", by dragging the lib(s) into the list under your Target > Build Phases > Link Binary With Libraries. 

Answers (0)