elliotwoods / ofxCanon

openFrameworks addon for control and capture from Canon DSLR's via the EDSDK
38 stars 11 forks source link

conflict with winioctl, unable to compile vs2017, of0.11.0 #14

Open Taprik opened 1 year ago

Taprik commented 1 year ago

I've used this addon with of 0.10 and lately try to use it with of 0.11.2 I've built my project in 2 ways and I have th same errors for both of them

elliotwoods commented 1 year ago

The error is a conflict between EDSDK itself and Windows SDK, i.e. not a conflict from the code in ofxCanon or openFrameworks. I'd suggest to try a different version of EDSDK (e.g. the readme for ofxCanon mentions versions which have been tested to work). I quickly checked my EDSDKTypes.h that I'm using here and there isn't an enum entry called simply 'Unknown' that would have this conflict (sadly, i couldn't find the version number that I'm using, but it's definitely after R5 support).

Suggestion: try earlier (or later) versions of EDSDK

Taprik commented 1 year ago

Dear Elliotwoods, You're fast! I'm using a pretty recent version (the 13.13 version). I'm successfully using it with ofxEdsdk also. the enum is at line 842 of the file edsdktypes.h and 7811 of winioctl.h. Same name but not the same enum ... `/----------------------------------------------------------------------------- ObjectFormat Code -----------------------------------------------------------------------------/ typedef enum { Unknown = 0x00000000, Jpeg = 0x3801, CR2 = 0xB103, MP4 = 0xB982, CR3 = 0xB108, HEIF_CODE = 0xB10B, } EdsObjectFormat;

I search the web about any error related to this and I found nothing I can understand `

elliotwoods commented 1 year ago

can you just rename the enum and get it working? if it works on ofxEdsdk it's probably because the include order is different somehow and then the two enums don't hit each other

this kind of error is fixed with c++'s class enum, but it looks like this code is trying to be C compliant

elliotwoods commented 1 year ago

hint : I won't attempt to 'properly' fix this until I hit this issue myself at the point where I'm actively developing something in oF anyway :)

Taprik commented 1 year ago

Thanks elliotwoods I rename the enum and it works. Cheers