Undefined symbols for architecture armv7 - Static Library - xcode

I'm from Argentina and my English is very limited. Sorry about that.
I tell them about my problem:
I downloaded the SDK for iOS Hikvision cameras from this link: http://www.hikvision.com/en/download_more.asp?id=1207
This includes static library file called "libPlayCtrl.a" and two headers "ApplePlayM4.h" & "PlayM4.h"
The problem is that to include the library in my project, I get the error:
"Undefined symbols for architecture armv7"
I followed the suggestions in this link: Undefined symbols for architecture armv7 and I could not compile the project in any way.
Has anyone worked with this program and can help me?
Thank you.

This question was posted awhile ago. I recently attempted to integrate the HikVision iOS Player SDK for a project as well. I ran into similar errors, symbols not defined for armv7 architecture, as well as a few others. The HikVision documentation for the sdk does not give you the dependent libraries for clean and easy integration. I have included the following libraries, CoreAudio, CoreVideo, AudioToolbox, and OpenAL, as well as the libstdc++.6.0.0.dylib. With all these included in a test project within my environment using XCode 7 with iOS 9 via swift. I created a bridging header (because of swift), imported the ApplePlayM4.h and was able to call the PlayM4_GetPort method. Please note the HikVision library is only compiled for device architectures, amrv7/armv64 and not i386 that is why it won't work in the simulator and only on a physical device.

Related

Unity build to xcode with gives error: Apple Mach-O Linker

I tried to google for the solution. I tried to delete the DerivedData folder but it still doesn't work... Why is this still happening? I am using Xcode version 6.2. Thanks.
Edit: Under the one error has 70 different errors saying various things. There is a warning saying
ld: warning: ignoring file /Users/Kevin Chen/Desktop/Parking Director/Libraries/libiPhone-lib.a, missing required architecture arm64 in file /Users/Mushrooms4Eva/Desktop/Parking Director/Libraries/libiPhone-lib.a (2 slices)
All of the following links and solutions did not work for me:
https://teamtreehouse.com/forum/apple-macho-linker-error-xcode-61
Apple Mach-O Linker Error when compiling for device
Sounds like your library libiPhone-lib.a is not compiled for arm64, but your project is set to be compiled for this architecture.
I think all the errors are triggered by this "warning" as the library is ignored, and therefore you may have a lot of missing references.
Your options:
Get a version of the lib compiled for arm64, or do it yourself, if you have the code
Remove arm64 architecture from your project (which I don't recommend, as you'll need to provide an 64bit build for the App Store, but that's another story)
How to make 64bit builds (available from Unity 4.6.2+)
iOS platform
Other Settings
Scripting Backend => IL2CPP
Architecture => Universal (to target both 32 and 64 bit)
How to build for simulator
Player Settings
iOS platform
SDK Version => Simulator SDK

StgCreateDocfile, etc. on MacOS 10.9.5

I'm having trouble linking an Xcode project using the AAF SDK, with Xcode 5.1.1 on MacOS 10.9.5. When I link the main dynamic library, these symbols come up missing:
_StgCreateDocfile
_StgCreateDocfileOnILockBytes
_StgOpenStorage
_StgOpenStorageOnILockBytes
AssertProc
I can't find a definition for them anywhere in the entire source tree for the SDK. The first four appear to be part of Structured Storage on Windows. A Structured Storage library is provided in the SDK and I'm already linking that.
Can anyone tell me of a Mac system library that defines these? Or is there a linker argument that pulls in a library for them? Thanks for any help.
A late answer (!), but in case anyone comes across this... The solution is either:
To use the makefiles with the AAF SDK to generate the AAF dylib,
which works fine. or...
If you use Xcode to build the AAF SDK, ensure the correct
#defines are kept, namely:
_DEBUG OM_DEBUG OM_STACK_TRACE_ON_ASSERT OM_USE_SCHEMASOFT_SS OM_STRUCTURED_STORAGE
Note that DEBUG=1 is absent (it is added by default by Xcode) - if defined, this brings in AssertProc. Define NDEBUG on release builds and omit the debug defines.
The Stg... functions are part of the MS implementation of Structured storage as you stated, but should not be referenced on a Mac, the Schemasoft implementation being used.

ld: library not found for (on Simulator only)

Suddenly began getting this error when running my app on iOS 7 Simulator.
ld: library not found for -lacmobileshim
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
On Device this problem doesn't happen and the app runs OK.
Have already searched for this library inside SDK but couldn't find it. Have no idea what's going on cause it was running OK both on Simulator and Devices before and haven't added any additional library to my project.
Is there a way to set Library Search Path in Build Settings just for this library?
Should reinstall SDK be a workaround?
These are the libraries i'm including in my project:
After get the same headache as updated to Xcode 6/iOS 8 sdk, just found a simple way to solve this issue with libacmobileshim.dylib and also other dynamic libraries that were causing the same problem when building the app on simulator. Just delete the dynamic libraries from Build Phases settings and the app is running perfectly again on simulator. Hope it may help someone with the same problem.
libacmobileshim.dylib is in the iOS Device SDK, but it is not in the simulator SDK. External developers should have no need for this library, so I'm confused as to why you're linking against it.
Looking at that list of libraries that you're linking against, I suspect a bunch of them aren't even needed by your project. You should audit that list and eliminate unnecessary linkage.

How do I solve a "dyld: Library not loaded:" error in Xcode 4 unit tests?

I have an Xcode 4 project, a Cocoa application with Spotlight, Core Data and unit tests. The app uses a custom framework named TBPluginManager I wrote to load bundles. I originally wrote the framework in Xcode 3 but when I used it in Xcode 4 GDB kept complaining, so I recreated the framework in Xcode 4. This made GDB happy, until I tried to run the built-in unit-test and got:
[Switching to process 3840 thread 0x0]
dyld: Library not loaded: > Library/Frameworks/TBPluginManager.framework/Versions/A/TBPluginManager
Referenced from: /Users/elise/Library/Developer/Xcode/DerivedData/BookManager-cooglmktssmptpatjuetculukiqd/Build/Products/Release/BookManager.app/Contents/MacOS/BookManager
Reason: image not found
sharedlibrary apply-load-rules all
No memory available to program now: unsafe to call malloc
Now I can understand why the unit test cannot find the framework since it lives not at Library/Frameworks/TBPluginManager.framework but at /Library/Frameworks/TBPluginManager.framework. But how do I tell that to the unit-test bundle? I've tried setting the Framework, Header and Library Search path build setting, but to no avail.
BTW, I've gone back to GHUnit but I'd like to get this working as well.
FOLLOW-UP: Much as it bugs me that Grady Player got an account just to tell me that I'm an idiot, it just may be that he or she is right. My lovely, dependable framework is generating warnings and errors like they're going out of fashion and so I've turned the problem over to Apple Developer Technical Support. If anything interesting comes out of it, I'll post it here. Otherwise, I'll delete the question.
make sure that the framework installed at /Library/Frameworks/TBPluginManager.framework is valid and the same arch as you are trying to link it to. If you are in doubt recompile the framework again, put it in a custom location and set that custom location in your framework search path.

XCode linking error when targeting armv7

I've already spent countless hours puzzling over this, utilizing Google searches and other Stack Overflow questions to no avail.
I have an iPhone/iPad universal application, which seems to compile fine when the target is armv6. However, when the device is iPad, I get this warning:
warning: building for SDK 'Device - iPhone OS 3.2' requires an armv7 architecture.
Oddly enough, the app still runs great on iPad in spite of this warning. However, I do want to do things the "right way" what ever that means in this case. When I switch the target architecture to armv7, I get linking errors:
"___restore_vfp_d8_d15_regs", referenced from:
*redacted*
"___save_vfp_d8_d15_regs", referenced from:
*redacted*
ld: symbol(s) not found
collect2: ld returned 1 exit status
The "redacted" portions of the errors are references to the static library to which I'm trying to link.
Here's what I've tried from the many suggestions online. Each of these were suggested more than once without any explanation, which leads me to believe nobody quite understands this problem:
"Never use the drop down menu in the upper left of the XCode window to choose the target. Instead, set this to Base SDK and then the Base SDK to iPhone OS 3.0 in the target configuration. Set the target device to your preferred target (iPad, iPhone OS 3.2 in my situation.)"
This yields the error "Library not found for -lcrt1.3.1.o"
"Make sure that GCC isn't linking against the wrong version of the standard library. (You'll have to make sure the LIBRARY_SEARCH_PATH doesn't have the wrong path in it.)"
My LIBRARY_SEARCH_PATH is already empty, so this doesn't seem relevant.
"Try compiling with GCC 4.0 rather than GCC 4.2."
I get a syntax error inside a UIKit header file. The error is "Syntax error before 'AT_NAME' token." The line is "UIKIT_EXTERN #interface UILocalizedIndexedCollation : NSObject."
Another project compiles just fine with the same target settings, which is really making me question my sanity. Could I be dealing with a corrupt XCode project?
If anyone knows what's actually happening and has a reference or doesn't mind explaining it, I would be so very grateful.
Cheers!
VFP between ARMv7 and ARMv6 differs in various ways. In ARMv7 its usually preferable to use NEON. The problem is your static library depends on VFP in ARMv6 - you either need to compile the library at ARMv7 or keep the whole application at ARMv6.
Reverting back to GCC 4.0 is silly - ARMv7 support was basically nonexistent back then unless Apple backported it.
I had the same errors except it was for armv6. I fixed them by unchecking "Compile for Thumb" in the project settings for the static library and the main project.
try do like this http://groups.google.com/group/three20/browse_thread/thread/31ddbc047aa1b9ae/c4c5827ab0c7a76f
As far as AT_NAME error is concerned one of the possiblity is
Check if you miss the #end in a class.
To know more about AT_NAME error visit the following link
http://iosdevelopertips.com/xcode/error-syntax-error-before-at_name-token.html

Resources