Problems with C++ video example: opencv_ffmpeg.dll "corrupt" - affdex-sdk

I was trying to run the video-demo sample application in the Affdex SDK, but ran into a linker error. In the in instruction page (http://developer.affectiva.com/v3/windows/) there is a point where it states:
"A dynamic library, opencv_ffmpeg.dll is required by VideoDetector". However, I could not find this .dll as part of either the SDK package or the github example code.
I downloaded the openCV version 3.1 which was mentioned as required dependency, but it did not have opencv_ffmpeg.dll either. It did have two files that seemed relevant : opencv_ffmpeg310.dll and opencv_ffmpeg310_64.dll. However, when I try to link the project with either of these files, I get the error:
Error LNK1107 invalid or corrupt file
So, I was just wondering what I'm doing wrong, and where could I find the correct opencv_ffmpeg.dll.
kind regards

A dynamic library, opencv_ffmpeg.dll is required by VideoDetector [c++] in runtime for the video decoding.
You can download the Affdex SDK 3.0 for Windows from the downloads page. Based on the architecture for which you downloaded the SDK for you can locate either opencv_ffmpeg248_64.dll at C:\Program Files\Affectiva\Affdex SDK\binor opencv_ffmpeg248.dll at C:\Program Files (x86)\Affectiva\Affdex SDK\bin.

Related

Debugging QuickLook plug-in with 'bundle is damaged' error

We're adding a QuickLook plug-in to our project.
Everything is fine until macOS trying to invoke our plug-in, at which point we're getting the beloved The bundle couldn’t be loaded because it is damaged or missing necessary resources error.
We've checked with otool -L on the plug-in's binary that all dependencies are in place, however as soon as the OS is asking our plug-in for a preview for the file type supported by us we get:
22/04/17 12:03:05,716 quicklookd[55323]:
[QL] Can't load plug-in at file:///Users/myname/Library/Developer/Xcode/DerivedData/The_Project-gpihzjouhxvifqcslmywktktizer/Build/Products/Debug/MyApp.app/Contents/Library/QuickLook/SomeQuickLookPlugIn.qlgenerator/:
The bundle “SomeQuickLookPlugIn” couldn’t be loaded because it is damaged or missing necessary resources.
The one thing we're not quite sure about is the dependency to our internal frameworks.
We've set up the plug-in similar to our main app, i.e. the private framework dependency resolves to:
#executable_path/../Frameworks/MyFW.framework/Versions/A/MyFW (compatibility version 1.0.0, current version 1.0.0)
..which would work OK if #executable_path were either the main app's binary or the plug-in's main binary as we copied the frameworks in both places in the bundle.
Any thoughts?
Ideally we would like the OS to tell us which dependency it failed to resolve -
is there any debug flag that can be set..?
As per https://www.mikeash.com/pyblog/friday-qa-2009-11-06-linking-and-install-names.html and http://www.dribin.org/dave/blog/archives/2009/11/15/rpath/ you should
set the Installation Directory for your referenced framework(s) to #rpath
in the app set Runtime Search Paths to #loader_path/../Frameworks
and in the QuickLook plug-in set Runtime Search Paths to #loader_path/../../../../../Frameworks as suggested by catlan -
that way you don't need to duplicate referenced frameworks inside the QuickLook plug-in
Compile, run, and everything should just work if everything else is set up correctly.
In addition you might want to check the code-signing settings in your plug-in to make sure there's no problems there.
One thing you can do is remove (or turn-off) code signing from your app and then see if it will load the plug-in…
To check if code-signing is the problem you can turn it off temporarily for your app using the Terminal to codesign --remove-signature YourApp.app and see if it works..
Run Search Paths should be #loader_path/../../../../../Frameworks because it is installed into Main.app/Contents/Library/QuickLook/QuickLookPlugin.qlgenerator/Contents/Mac/QuickLookPlugin, so we need to go five folders down from the #loader_path to find the frameworks folder.

Problems archiving project with react-native-fbsdk

I have managed to get react-native-fbsdk (core, login and share) all working in my project. I can build to devices without issue but if I try to create an archive from Xcode I get the error
Lexical or Preprocessor Issue
'RCTBridgeModule.h' file not found
I have followed the install instructions and create a virgin project and done it again to ensure nothing else could be causing this.
Similar Xcode related questions have come up blank for me too:
Xcode 4 can't locate public header files from static library dependency
When archiving app Xcode complains about missing files
Xcode 4 and nested projects -- header files not found
This makes me wonder if there's something else to to with FBSDK specifically that I need to do to get it to archive properly.
Has anyone got a project to archive with react-native-fbsdk? If so, how?
Note: I skipped the step regarding explicitly naming the path for static libraries as I do not know what the name should be; I do not know which the static library would be fbsdkcore (etc) or react-native/react.
I appears that the repo had an error in its header search paths in 'release' distribution. The fix was to correct the xcodeproj in the plugin (A PR is currently going through for this) as outlined here
The following line is present in the debug distribution but not in release for any of the required xcodeproj's
"$(SRCROOT)/../../node_modules/react-native/React/**",
Adding this fixes the error.
Full Source Code Alterations

Packaging Unreal Build Configurations

I have integrated the Steam API with my project and I had to add the actual API to the include directories of my DebugGame_Editor Configuration as well as the library directory.
The editor has been building properly for a month and Steam runs in-game, but now I have gotten to packaging my game and I am getting an error:
Cannot open include file: 'steam/steam_api.h': No such file or directory.
I assume that the configuration that it is using to package the game is missing those include directories and the library directory. Which configuration does UE4 use when packaging a game for Win64? There are like 40, and I don't want to try each and every one.
Engine Version: 4.7.6 from source (GitHub)
Edit:
I have gone through all configurations in the configuration manager in Visual Studio and added the two directories to the include and library sections of both Win32 and x64 in all of them (except the ones that say Mac or IOS), but no dice. It still throws that error message when it is trying to build ProjectName.generated.cpp
I'm not sure what to try next.
So I was able to fix this problem by including the files with an absolute path, rather than relying on relative include paths.

RNCryptor Dyld Error Message: Library not loaded

So, I've tired everything to get this to work after I've archived the application, but it keeps failing to open with the error message:
Dyld Error Message:
Library not loaded: /Library/Frameworks/RNCryptor.framework/Versions/A/RNCryptor
Referenced from: /Users/USER/Desktop/Project.app/Contents/MacOS/Project
Reason: image not found
I've added the Framework to the Copy Files Build Phase, I've changed the Runpath Search Paths to #loader_path/../Frameworks and the Framework Search Path to #executable_path/../Frameworks and it still doesn't want to open.
It opens fine in Xcode itself, but as soon as it's archived, it complains and doesn't run.
Any help is much appreciated :)
Ok, so I was able to fix it.
So the application was actually looking for the Framework in /Library/Frameworks/ on my Mac, I originally had thought it was looking for a reference in my actual .app file.
To fix it I opened up Terminal, cd' into the folder containing a copy of RNCryptor.framework and used this command
install_name_tool -id #executable_path/../Frameworks/RNCryptor.framework/RNCryptor RNCryptor.framework/RNCryptor
Then removed the old framework from the Xcode Project and re-inserted it using the Framework I just used from the directory I cd' into, and added the new Framework to the Copy Files Build Phase.
And voila, it worked :)

Using the ConnectionKit Framework Within an NSBundle

Update
I've since spent time learning how to use install_name_tool & otool to do this properly, and documented the process here: Using Frameworks Within NSBundles
I would like to use the Connection Kit framework within an NSBundle I am making.
To allow my bundle to load the framework successfully, I've changed the dynamic library install name to use #loader_path as opposed to #executable_path.
After building and including the framework in my NSBundle, then building that, running the program that loads my bundle, my bundle fails to load and produces the following output:
Error loading MyBundle.rwplugin/Contents/MacOS/MyBundle: dlopen(/Users/facelap/Library/Developer/Xcode/DerivedData/MyBundle-hiyhdkndcnuhspfqwcuyneqobeou/Build/Products/Debug/MyBundle.rwplugin/Contents/MacOS/MyBundle, 265): Library not loaded: #executable_path/../Frameworks/DAVKit.framework/Versions/A/DAVKit
Referenced from: /Users/facelap/Library/Developer/Xcode/DerivedData/MyBundle-hiyhdkndcnuhspfqwcuyneqobeou/Build/Products/Debug/MyBundle.rwplugin/Contents/MacOS/../Frameworks/Connection.framework/Versions/A/Connection
Reason: image not found
It seems that Connection Kit itself uses a framework.
I also have the source for this framework. I tried setting its dynamic library install name to #loader_path, but this resulted in similar output (and the bundle failed to loar).
What would a sane entry be for the dynamic library install name for a framework within a framework that is to be used within an NSBundle?
Look at the crash log. It says that you bundle can't load DAVKit.framework so the easiest way - its rebuild ConnectionKit framework but instead of embedding DAVKit.xcodeproj insert all sources of DAVKit. Its easiest way but more correctly - its setup install path of ConnectionKit and DAVKit frameworks.
Its link should help you:
embedding frameworks in loadable bundles
You should link your bundle with DAVKit and include it there In the same way as you're including ConnectionKit. This avoids having multiple depths of frameworks being shipped