ios - linking to third-party static library: "file was built for archive which is not the architecture being linked (i386)" -


I am trying to use a third party open source C ++ static library. I downloaded the archive from the project's web site, run ./configuration - disabled-shared , then create , test , and < Code> install . (I am a UNIX novice, so it was following the instructions given on the project's web site.)

In the encode, I clicked under the link from the lib folder. Added include folder in the binary, header search path with libraries, and added the -ObjC to another linker flag (although I do not think since the library One important is C ++)

When I try to build a project, I get several warnings like

  ld: warning: file / user / & Lt; My name & gt; / Dropbox / Computing / COIN -OR / Cbc-2.8.10 / lib / libOsiCbc.a, the file was created for archiving which is not related to architecture (i386): / user / & lt; My name & gt; / Dropbox / Computing / COIN-OR / Cbc- 2.8.10 / lib / libOsiCbc.a  

and many errors such as

  Undefined symbols for architecture I386: Referenced from: "_CbcOrClpReadCommand", CoinReadNextField () in CBCROPARMO  

I know that there are many threads on the stack overflow about this error, and when correcting the solution library is correct Architecture (arm and i386) is to include. But since it is a third-party library, I'm not compiling it in Xcode. Can I fix the problem in the Shell Stages listed above?

Because it is open source, I can get the source code, but I do not know how to create a library at that point. How to create / P>

It depends on how the open source code was written. But most libraries use the configured parameter to do this. It may be possible to see a parameter like ./configure- arch i386 then create & amp; Install You should know it from README or how to use documents . Or would you like to ask the author better.

After you compile them, you .a the file lipo added to your project

  lipo -Caret / Path / Tot / On / A / Path / To / Ner / AO-Output LibOCCBCA  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -