elliotwoods / ofxMachineVision

Interfaces and helpers for working with machine vision cameras
17 stars 12 forks source link

Compiling Steps Issues // Win, VS2015 and ofF0.9.8 // webcam, ofxSpinnaker #11

Closed carlesgutierrez closed 6 years ago

carlesgutierrez commented 6 years ago

Hello @elliotwoods , So great addon here 👍

I'm trying to get it working and check if I'm doing right the VS steps to have a Flir camera working with ofxSpinnaker:

  1. Add the ofxMachineVisionLib/ofxMachineVisionLib.vcxproj project to your solution

ok

  1. Go to your project properties, go to 'Common Properties' at the top of the tree on the left, select 'Add New Reference...' and add the ofxMachineVisionLib project. Using VS2015 I've only saw this option: right Click over my example project, add Reference
    1. Add the props file from your camera driver to your project: Go to Property Manager tab Right click on your project 'Add Existing Property Sheet...' Select the property sheet for your camera driver addon (e.g. addons/ofxXimea/ofxXimea.props) ok
    2. Add the source files from your camera driver to your project (.cpp, .h) How might be done this? Using ProjectGenerator and adding the ofxSpinnaker? Or just dragging the ofxSpinaker.h, Spinnaker.h and Spinnaker.cpp into my source project ( next to testApp.h ) without forgot to add Aditional Include Directories: "../../../addons/ofxSpinnaker/src" and "..\..\..\addons\ofxSpinnaker\src\ofxMachineVision\Device"
    3. Include the camera driver header in your testApp.h (e.g. ofxXimea.h) or as appropriate ok
    4. Denote your camera driver's Device class when instantiating ofxMachineVison::Grabbers (e.g. ofxMachineVision::SimpleGrabber grabber;) `ok, "ofxMachineVision::SimpleGrabber camera;"

I've followed all this steps, but without success. I've got following errors:

With ofxSpinnaker:

3>c1xx : fatal error C1083: Cannot open source file: '..\..\..\addons\ofxMachineVision\src\ofxMachineVision\Device\StillImages.cpp': No such file or directory 3> VideoPlayer.cpp 3> Frame.cpp 3>d:\develop\of\of_v0.9.8_vs_release\addons\ofxspinnaker\src\ofxMachineVision/Device/Spinnaker.h(5): fatal error C1083: Cannot open include file: 'spinnaker/Spinnaker.h': No such file or directory (compiling source file src\testApp.cpp) 3> Base.cpp 3>d:\develop\of\of_v0.9.8_vs_release\addons\ofxspinnaker\src\ofxMachineVision/Device/Spinnaker.h(5): fatal error C1083: Cannot open include file: 'spinnaker/Spinnaker.h': No such file or directory (compiling source file src\main.cpp)

Doing less steps for Device::Webcam, I've got also this other error: 1>D:\develop\oF\of_v0.9.8_vs_release\addons\ofxMachineVision\src\ofxMachineVision.h(49): error C2664: 'void ofxMachineVision::Grabber::Base::setDevice(ofxMachineVision::DevicePtr)': cannot convert argument 1 from 'std::shared_ptr<ofxMachineVision::Device::Type>' to 'ofxMachineVision::DevicePtr'

carlesgutierrez commented 6 years ago

Re-Edited:

-> 4th step: Ive installed propietary drivers from [here ]((https://www.ptgrey.com/support/downloads) and installed ("SpinnakerSDK_FULL_1.13.0.33x64.exe") win10 64b After installation the includes of the driver are located at -->"C:\Program Files\Point Grey Research\Spinnaker\include"_ but to use this include directly in my project properties, I've to add a folder spinnaker**** to match it with ofxSpinnaker includes:

#include "spinnaker/Spinnaker.h"
#include "spinnaker/SpinGenApi/SpinnakerGenApi.h"

Atomic include seems to be required: #include <atomic>

Actual error:

2>ofxMachineVision.h(49): error C2664: 'void ofxMachineVision::Grabber::Base::setDevice(ofxMachineVision::DevicePtr)': cannot convert argument 1 from 'std::shared_ptr' to 'ofxMachineVision::DevicePtr' (compiling source file src\main.cpp)

This is the same error as when using webCam. What I'm missing? Cheers

elliotwoods commented 6 years ago

hey there! which time zone are you on? i'm on Korea time (GMT+8). Could do a skype? check your email

carlesgutierrez commented 6 years ago

Hello Elliot, We checked this with @jordiexvision and he found the error:

        SimpleGrabber() : Grabber::Simple() {
            //this->setDevice(make_shared<Device::Type>());
            this->setDevice(make_shared<DeviceType>());
        }

He adapted it also to of 0.1. In case you want to add it. Now I'm able to compile and see webcam working! :)

I've still library issues with Spinnaker. I'm working on. Let's talk when you want.

carlesgutierrez commented 6 years ago

Thanks for you help @elliotwoods I've added a example of spinnaker working at this fork. But when I've tried to create the project from scratch I've did something wrong. I've uploded both examples just to check what is wrong. My actual error is :

4>..\..\..\addons\ofxSpinnaker\libs\Spinnaker\bin\vs\x64\Debug\Spinnakerd_v140.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x428 ========== Build: 3 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

@elliotwoods :

It sounds like you've added the DLL into the linker options You should add the lib to the linker options and copy the DLL to the output folder ofxSpinnaker should do both for you though I think

I did not add DLL in the Linker options: And comparing both projects ant not able to find where mistake is. Both projects sharing same ofxSpinnaker addon so they have the right .lib's added.

working project: workinglib

New project not working: errordlllib

And the the .lib added in the debug and release folders respectively:

debug_libadded

I will keep working on! Any ideas welcome.

carlesgutierrez commented 6 years ago

Finally I found what @elliotwoods commented. When the project is created by PG it adds Spinnakerd_v140.dll into linker options. Removing it from there(Debug and Release) did the work. 👍

errordll

elliotwoods commented 6 years ago

great!