depthjs icon indicating copy to clipboard operation
depthjs copied to clipboard

Failed to build plugin on OSX

Open nickhs opened this issue 11 years ago • 8 comments

I'm getting a build error in the post build steps when trying to compile the plugin for chrome.

=== BUILD NATIVE TARGET depthjsplugin OF PROJECT FireBreath WITH THE DEFAULT CONFIGURATION (Debug) ===
Check dependencies

PhaseScriptExecution "CMake PostBuild Rules" /Users/nickhs/sandpit/depthjs/firebreath-plugin/build/projects/depthjsplugin/FireBreath.build/Debug/depthjsplugin.build/Script-39CD5B19FF39447FA38D1A24.sh
    cd /Users/nickhs/Downloads/firebreath-FireBreath-b73d799
    /bin/sh -c /Users/nickhs/sandpit/depthjs/firebreath-plugin/build/projects/depthjsplugin/FireBreath.build/Debug/depthjsplugin.build/Script-39CD5B19FF39447FA38D1A24.sh
cd /Users/nickhs/sandpit/depthjs/firebreath-plugin && /Users/nickhs/sandpit/depthjs/firebreath-plugin/simple_templater ../chrome-extension/manifest.json.MACOSX !!PRODUCT_NAME!! DepthJSPlugin ../chrome-extension/manifest.json
found token in line.
cd /Users/nickhs/sandpit/depthjs/firebreath-plugin && cp -R /Users/nickhs/sandpit/depthjs/firebreath-plugin/build/projects/depthjsplugin/Debug/DepthJSPlugin.plugin ../chrome-extension/plugin/
cp: /Users/nickhs/sandpit/depthjs/firebreath-plugin/build/projects/depthjsplugin/Debug/DepthJSPlugin.plugin: No such file or directory
make: *** [depthjsplugin_buildpart_0] Error 1


** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution "CMake PostBuild Rules" 

Note that the directory actually looks like this:

projects/depthjsplugin/Debug
└── npdepthjsplugin.plugin
    └── Contents
        ├── Info.plist
        ├── MacOS
        │   └── npdepthjsplugin
        └── Resources
            ├── English.lproj
            │   ├── InfoPlist.strings
            │   └── Localized.rsrc
            └── Sample-Tracking.xml

5 directories, 5 files

It would appear that its attempting to copy across DepthJSPlugin.plugin when the plugin has been named npdepthjsplugin.plugin by make? Any ideas?

nickhs avatar May 13 '13 23:05 nickhs

Are you using XCode to build it? I think XCode might be building it with a different name..

royshil avatar May 13 '13 23:05 royshil

It's being built with the xcodebuild command line utility (so yes?). Is there a different way I could try?

nickhs avatar May 13 '13 23:05 nickhs

You can try to use proper XCode to build, open the $DJS/firebreath-plugin/build/FireBreath.xcodeproj

royshil avatar May 14 '13 00:05 royshil

Sorry I should of clarified, I've tried with both XCode and xcodebuild to no avail. I'm not entirely sure where it's getting the np from.

This is on XCode 4.6, OSX 10.7.5. screen shot 2013-05-13 at 5 36 22 pm

nickhs avatar May 14 '13 00:05 nickhs

I believe it originates from the PluginConfig.cmake file, that sets the name of the product. See if has the following:

set(FBSTRING_ProductName "DepthJSPlugin")
set(FBSTRING_PluginName "DepthJSPlugin")

these determine the file to be copied.

royshil avatar May 14 '13 03:05 royshil

Changing the following line in firebreath-plugin/PluginConfig.cmake worked!

-set(FBSTRING_PluginFileName "np${PLUGIN_NAME}.dll")
+set(FBSTRING_PluginFileName "${PLUGIN_NAME}.dll")

Unfortunately the plugin still appears to fail to load, Chrome spits out:

[10987:519:0514/162559:ERROR:plugin_lib_mac.mm(212)] PluginLib::ReadWebPluginInfo bundle failed preflight: The bundle “depthjsplugin.plugin” couldn’t be loaded because it is damaged or missing necessary resources.

Running otool -L on the plugin gives the following:

/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 833.25.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 41.0.0)
    /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 395.11.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 17.0.0)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 153.0.0)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.7.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 635.21.0)
    ../../Bin/x64-Release/libOpenNI.dylib (compatibility version 0.0.0, current version 0.0.0)
    ../../../Bin/x64-Release/libXnVCNITE_1_5_2.dylib (compatibility version 0.0.0, current version 0.0.0)
    ../../Bin/x64-Release/libXnVFeatures_1_5_2.dylib (compatibility version 0.0.0, current version 0.0.0)
    ../../Bin/x64-Release/libXnVHandGenerator_1_5_2.dylib (compatibility version 0.0.0, current version 0.0.0)
    ../../../Bin/x64-Release/libXnVNITE.jni.dylib (compatibility version 0.0.0, current version 0.0.0)
    ../../Bin/x64-Release/libXnVNite_1_5_2.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 53.0.0)

I've confirmed that all the libraries exist in /usr/lib and have the dyld fallback path set appropriately. Unfortunately I have no idea how to try and debug the issue further with the plugin.

nickhs avatar May 14 '13 23:05 nickhs

I haven't encountered that error yet... You can learn how to debug the plugin here: http://www.firebreath.org/display/documentation/Debugging+Plugins It has instructions for Mac+Chrome

royshil avatar May 15 '13 14:05 royshil

I know this is old, but I wanted to say I can't build in Xcode 5 in Mavericks on Mac. I went through every step in the README successfully, but failed trying to build in Xcode.

ld: warning: ignoring file /usr/local/lib/libOpenNI.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libOpenNI.dylib
Undefined symbols for architecture i386:
  "_xnContextAddRef", referenced from:
      xn::Context::SetHandle(XnContext*) in openni_backend.o
  "_xnContextRegisterForShutdown", referenced from:
      xn::NodeWrapper::SetHandle(XnInternalNodeData*) in openni_backend.o
      xn::Context::SetHandle(XnContext*) in openni_backend.o
  "_xnContextRelease", referenced from:
      xn::NodeWrapper::SetHandle(XnInternalNodeData*) in openni_backend.o
      xn::Context::TakeOwnership(XnContext*) in openni_backend.o
      xn::Context::SetHandle(XnContext*) in openni_backend.o
  "_xnContextUnregisterFromShutdown", referenced from:
      xn::NodeWrapper::SetHandle(XnInternalNodeData*) in openni_backend.o
      xn::Context::SetHandle(XnContext*) in openni_backend.o
  "_xnConvertRealWorldToProjective", referenced from:
      xn::DepthGenerator::ConvertRealWorldToProjective(unsigned int, XnVector3D const*, XnVector3D*) const in openni_backend.o
  "_xnEnumerationErrorsAllocate", referenced from:
      xn::EnumerationErrors::EnumerationErrors() in openni_backend.o
  "_xnEnumerationErrorsFree", referenced from:
      xn::EnumerationErrors::Free() in openni_backend.o
  "_xnEnumerationErrorsToString", referenced from:
      xn::EnumerationErrors::ToString(char*, unsigned int) in openni_backend.o
  "_xnFindExistingRefNodeByType", referenced from:
      xn::Context::FindExistingNode(int, xn::ProductionNode&) const in openni_backend.o
  "_xnForceShutdown", referenced from:
      xn::Context::SetHandle(XnContext*) in openni_backend.o
  "_xnGetRefContextFromNodeHandle", referenced from:
      xn::NodeWrapper::SetHandle(XnInternalNodeData*) in openni_backend.o
  "_xnGetStatusString", referenced from:
      OpenNIBackend::init() in openni_backend.o
      OpenNIBackend::setKinectAngle() in openni_backend.o
  "_xnInitFromXmlFileEx", referenced from:
      xn::Context::InitFromXmlFile(char const*, xn::ScriptNode&, xn::EnumerationErrors*) in openni_backend.o
  "_xnOSFree", referenced from:
      xn::GestureGenerator::RegisterToGestureIntermediateStageCompleted(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, void*), void*, void*&) in openni_backend.o
      xn::GestureGenerator::RegisterToGestureReadyForNextIntermediateStage(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, void*), void*, void*&) in openni_backend.o
      xn::GestureGenerator::RegisterGestureCallbacks(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, XnVector3D const*, void*), void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, float, void*), void*, void*&) in openni_backend.o
  "_xnOSMalloc", referenced from:
      xn::GestureGenerator::RegisterToGestureIntermediateStageCompleted(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, void*), void*, void*&) in openni_backend.o
      xn::GestureGenerator::RegisterToGestureReadyForNextIntermediateStage(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, void*), void*, void*&) in openni_backend.o
      xn::GestureGenerator::RegisterGestureCallbacks(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, XnVector3D const*, void*), void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, float, void*), void*, void*&) in openni_backend.o
  "_xnProductionNodeAddRef", referenced from:
      xn::NodeWrapper::SetHandle(XnInternalNodeData*) in openni_backend.o
  "_xnProductionNodeRelease", referenced from:
      xn::NodeWrapper::SetHandle(XnInternalNodeData*) in openni_backend.o
      xn::NodeWrapper::TakeOwnership(XnInternalNodeData*) in openni_backend.o
  "_xnRegisterGestureCallbacks", referenced from:
      xn::GestureGenerator::RegisterGestureCallbacks(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, XnVector3D const*, void*), void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, float, void*), void*, void*&) in openni_backend.o
  "_xnRegisterToGestureIntermediateStageCompleted", referenced from:
      xn::GestureGenerator::RegisterToGestureIntermediateStageCompleted(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, void*), void*, void*&) in openni_backend.o
  "_xnRegisterToGestureReadyForNextIntermediateStage", referenced from:
      xn::GestureGenerator::RegisterToGestureReadyForNextIntermediateStage(void (*)(xn::GestureGenerator&, char const*, XnVector3D const*, void*), void*, void*&) in openni_backend.o
  "_xnSetTrackingSmoothing", referenced from:
      xn::HandsGenerator::SetSmoothing(float) in openni_backend.o
  "_xnStartGeneratingAll", referenced from:
      xn::Context::StartGeneratingAll() in openni_backend.o
  "_xnUSBCloseDevice", referenced from:
      OpenNIBackend::setKinectAngle() in openni_backend.o
  "_xnUSBInit", referenced from:
      OpenNIBackend::setKinectAngle() in openni_backend.o
  "_xnUSBOpenDevice", referenced from:
      OpenNIBackend::setKinectAngle() in openni_backend.o
  "_xnUSBSendControl", referenced from:
      OpenNIBackend::setKinectAngle() in openni_backend.o
  "_xnWaitOneUpdateAll", referenced from:
      xn::Context::WaitOneUpdateAll(xn::ProductionNode&) in openni_backend.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've tried building for both i386 and x86_64 architectures with no luck

joelcdoyle avatar Apr 25 '14 23:04 joelcdoyle