hkr / fuji-cam-wifi-tool

Trying to reverse-engineer the wifi remote control protocol used by Fuji X series cameras
The Unlicense
234 stars 37 forks source link

error when building #12

Closed dvdmrn closed 3 years ago

dvdmrn commented 5 years ago

I'm able to install just fine until I get to cmake --build .. I get the following error:

Scanning dependencies of target fuji_cam_wifi                                                                                                                      
[  7%] Building CXX object lib/CMakeFiles/fuji_cam_wifi.dir/src/capabilities.cpp.o                                                                                 
In file included from /mnt/c/Users/dgmma/Documents/fuji-tool/fuji-cam-wifi-tool/lib/src/capabilities.cpp:1:0:                                                      
/mnt/c/Users/dgmma/Documents/fuji-tool/fuji-cam-wifi-tool/lib/include/capabilities.hpp:82:25: error: declaration of ‘fcwt::data_type fcwt::capability::data_type’ [
-fpermissive]                                                                                                                                                      
   data_type data_type = data_type_unknown;                                                                                                                        
                         ^                                                                                                                                         
/mnt/c/Users/dgmma/Documents/fuji-tool/fuji-cam-wifi-tool/lib/include/capabilities.hpp:40:6: error: changes meaning of ‘data_type’ from ‘enum fcwt::data_type’ [-fp
ermissive]                                                                                                                                                         
 enum data_type : uint16_t {                                                                                                                                       
      ^                                                                                                                                                            
lib/CMakeFiles/fuji_cam_wifi.dir/build.make:62: recipe for target 'lib/CMakeFiles/fuji_cam_wifi.dir/src/capabilities.cpp.o' failed                                 
make[2]: *** [lib/CMakeFiles/fuji_cam_wifi.dir/src/capabilities.cpp.o] Error 1                                                                                     
CMakeFiles/Makefile2:85: recipe for target 'lib/CMakeFiles/fuji_cam_wifi.dir/all' failed                                                                           
make[1]: *** [lib/CMakeFiles/fuji_cam_wifi.dir/all] Error 2                                                                                                        
Makefile:127: recipe for target 'all' failed                                                                                                                       
make: *** [all] Error 2       

Any ideas as to why?

(I'm using an ubuntu bash emulator on windows)

ppalasek commented 5 years ago

I had the same problem. I managed to compile and run it by doing the following changes:

Changed line 82 in capabilities.hpp to: data_type _data_type = data_type_unknown;

Changed lines 124-126 and 129 in capabilities.cpp to:

printf("\t\t    min: %d\n", cap_value_to_int(cap._data_type, cap.min_value));
printf("\t\t    max: %d\n", cap_value_to_int(cap._data_type, cap.max_value));
printf("\t\t    step: %d\n", cap_value_to_int(cap._data_type, cap.step_size));

printf("\t\t%d\n", cap_value_to_int(cap._data_type, cap.values[i]));

Changed lines 171 and 174 in commands.cpp to:

memcpy(&cap._data_type, data + offset, 2);

value_size = data_type_size(cap._data_type);

This worked for me, but I just wanted to get it running quickly, there's probably an easier/better solution (maybe we have wrong versions of something?).

I'm on ubuntu 16.04, cmake version 3.5.1, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

sdroamt0 commented 5 years ago

sandroPatch.diff.gz

this patch should allow to compile without such error (I'm on debian buster) to apply:

gunzip sandroPatch.diff.gz; 
cd fuji-cam-wifi-tool; 
patch -p1 < ../sandroPatch.diff

or better:

cd fuji-cam-wifi-tool;
gunzip -c ../sandroPatch.diff.gz | patch -p1
NikosAlexandris commented 4 years ago

Why is this patch not committed upstream?

sdroamt0 commented 4 years ago

Why is this patch not committed upstream?

I don't know... maybe it doesn't work on the maintainer's system or the project owner is not interested anymore to maintain it!

mzealey commented 4 years ago

I have pushed this fix to a forked repo https://github.com/mzealey/fuji-cam-wifi-tool b65b9c4

hkr commented 3 years ago

Should be fixed after merging https://github.com/mzealey/fuji-cam-wifi-tool