Tuesday, September 24, 2013

Compiled static library, running on a real machine error

first note:
I use Xcode4.5 + IOS6.0

To put things in a good package, I broke a static library, compile and consequently passed, the emulator compiled out. A library in other projects (A), reference can be used normally (simulator case of normal ).
But the real machine compiled out. A library files referenced in other projects, the case of a real machine to compile enough.
Error:

Undefined symbols for architecture armv7:
"_WebRtcIlbcfix_DecoderCreate", referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
"_WebRtcIlbcfix_EncoderFree", Referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
"_WebRtcIlbcfix_Decode", Referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
"_WebRtcIlbcfix_DecoderInit", Referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
"_WebRtcIlbcfix_DecodePlc", Referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
"_WebRtcIlbcfix_Encode", Referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
"_WebRtcIlbcfix_EncoderCreate", Referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
"_WebRtcIlbcfix_DecoderFree", Referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
"_WebRtcIlbcfix_EncoderInit", Referenced from:
CMedia :: Process (void *) in sxLibDial.a (media.o)
ld: symbol (s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use-v to see invocation)


I looked at the terminal, sxLibDial.a is armv7's.
Ask for advice, should be under the real machine how to compile and use static libraries?
Thank you friends ~ ~ ~ ~ ~

Reply:
Simulator is a i386 system, you determine armv7 compiled libraries? Or it may have other library dependencies sxLibDial
Reply:
quote 1 floor gdronron reply:
simulator is a i386 system, you determine armv7 compiled libraries? Or it may have other library dependencies sxLibDial


Is armv7 compiled libraries.
sxLibDial is dependent on another library, which I quoted in sxLibDial that library (A).
After that I have added in my project that library A, and then compile it.
Now, however, still have a question: Why is the translation of the i386 will not need to cite bank A can be used directly,
And armv7 compiled libraries, still need to do A reference library?
And banks A relatively large, but the contents of error involves only the contents of a file.
Reply:
i386 compiler theory but also, you can check the project configuration, see the simulator and the real machine library search path such there is no difference,
Reply:
Compile out. a document can be divided into two kinds of simulators and real machine ah, when running on a real machine, select the real machine. a file can ah
Reply:
3rd floor gdronron reply quote:
i386 compiler theory but also, you can check the project configuration, see the simulator and the real machine library there is no difference between this type of search paths,

Should be no difference, I started out with the simulator compiler. A file after the test,
I then compiled out of the real machine. A file to replace the previously compiled simulator that out. A file for testing.

However, do not rule out other factors that affect the middle, so get ready to start again.
Reply:
Lane once again, whether the simulator or a real machine, the only need to reference a static library of the (no longer be included in other projects I mentioned above, A library).
Now there is a little problem is that the real machine does not support armv7s, compiled on the error. I'm making a static library, followed by the addition of armv7s.
But still does not work. We do not know how to make compatible armv7s static library. Solution. . .
Hee hee
Reply:
Your landlord can not give way Yeah, I am also. A library of the SDK package somewhere else this time out alone. A project file to another time to be wrong, wrong, and as you begin to hair
Reply:
8th Floor huangyushi reply quote:
landlord can give you a way Yeah, I am also. a library package elsewhere SDK this When separate out. A project file to another time to be wrong, wrong, and you begin to same


First, you make sure you include another SDK is not the i386 and armv7 both architectures are supported.
Secondly, put another SDK to add to your library inside, there is likely to involve the path of the class. This step can not be mixed up.
Finally, the compiler through your library, see you pick out the simulator or a real machine compilation compiled out.
Compiled simulator can only be used for the simulator, a real machine can only be used for the translation of the real machine.
You can use lipo-info XXX.a see if it is i386 or armv7.
If you want the whole out of a generic library, you can use the command lipo-create Aa Ba-output AB.a
Such AB.a is a real machine and the simulator can be used up.

By the way, the last point, you need an SDK which contains other system libraries used in your project which had added to the job


Reply:
I am now more tangled plus point is that those references, check the information has said that the use gcc command added to the project, but in this test has not been successful, the problem may be the path, still in the trial, thank you.

No comments:

Post a Comment