lwille / node-gphoto2

A Node.js wrapper for libgphoto2
MIT License
296 stars 91 forks source link

Build Issue on OSX Lion #18

Closed jschappet closed 11 years ago

jschappet commented 12 years ago
node-waf configure build
Checking for program g++ or c++          : clang 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
Checking for libgphoto2                  : yes 
Checking for libgphoto2_port             : yes 
'configure' finished successfully (0.070s)
Waf: Entering directory `/Users/schappetj/CameraControl/node-gphoto2/build'
[1/9] cxx: src/preview.cc -> build/Release/src/preview_1.o
[2/9] cxx: src/autodetect.cc -> build/Release/src/autodetect_2.o
[3/9] cxx: src/binding.cc -> build/Release/src/binding_2.o
[4/9] cxx: src/camera.cc -> build/Release/src/camera_2.o
../src/preview.cc:28:3: error: no matching function for call to 'gp_context_set_error_func'
  gp_context_set_error_func (context, error_func, NULL);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/gphoto2/gphoto2/gphoto2-context.h:89:6: note: candidate function not viable: no known conversion from 'void
      (GPContext *, const char *, __va_list_tag *, void *)' to 'GPContextErrorFunc' (aka 'void (*)(GPContext *, const char *, void *)') for 2nd argument
void gp_context_set_error_func     (GPContext *context,
     ^
../src/preview.cc:29:2: error: no matching function for call to 'gp_context_set_status_func'
        gp_context_set_status_func (context, error_func, NULL);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/gphoto2/gphoto2/gphoto2-context.h:91:6: note: candidate function not viable: no known conversion from 'void
      (GPContext *, const char *, __va_list_tag *, void *)' to 'GPContextStatusFunc' (aka 'void (*)(GPContext *, const char *, void *)') for 2nd argument
void gp_context_set_status_func    (GPContext *context,
     ^
2 errors generated.
Waf: Leaving directory `/Users/schappetj/CameraControl/node-gphoto2/build'
Build failed:  -> task failed (err #1): 
        {task: cxx preview.cc -> preview_1.o}
make: *** [all] Error 1
lwille commented 12 years ago

which libgphoto2 version do you have?

jschappet commented 12 years ago

The latest from MacPorts, 1.0.9 I believe. checking now

lwille commented 12 years ago

Current is 2.5.0, my last build was with 2.4.13 (didn't have the time yet).

You can use homebrew to install libgphoto2-2.4.13 or install from source

jschappet commented 12 years ago

K, I removed libgphoto2 and reinstalled using homebrew.

Now I get:

tsunami:node-gphoto2 schappetj$ make
node-waf configure build
Checking for program g++ or c++          : clang 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
Checking for libgphoto2                  : yes 
Checking for libgphoto2_port             : yes 
'configure' finished successfully (0.189s)
Waf: Entering directory `/Users/schappetj/Dropbox/CameraControl/node-gphoto2/build'
[8/9] cxx_link: build/Release/src/preview_1.o -> build/Release/preview
ld: warning: ignoring file Release/src/preview_1.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /usr/local/Cellar/libgphoto2/2.4.14/lib/libgphoto2.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /usr/local/Cellar/libgphoto2/2.4.14/lib/libgphoto2_port.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /usr/local/Cellar/libexif/0.6.20/lib/libexif.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Waf: Leaving directory `/Users/schappetj/Dropbox/CameraControl/node-gphoto2/build'
Build failed:  -> task failed (err #1): 
        {task: cxx_link preview_1.o -> preview}
make: *** [all] Error 1
lwille commented 12 years ago

Did you make clean before?

jschappet commented 12 years ago

Yes, sure did. I have now tried it on two machines, same result.

lwille commented 12 years ago

Hi @jschappet,

have you already solved the problem? I have moved three days ago and many things have to be taken care of, so I didn't find the time to look into this issue yet.

jschappet commented 12 years ago

Sorry, I ended up using motion and a $15 web cam

http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome

lwille commented 12 years ago

Looks like you did the right thing - gphoto is neither capable of doing motion detection nor controlling webcams.

Good luck!

Leonhardt Wille Gesendet mit Sparrow (http://www.sparrowmailapp.com/?sig)

Am Freitag, 24. August 2012 um 18:30 schrieb James Schappet:

Sorry, I ended up using motion and a $15 web cam http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome

— Reply to this email directly or view it on GitHub (https://github.com/lwille/node-gphoto2/issues/18#issuecomment-8007570).

jschappet commented 12 years ago

I may come back to this for some other projects. Please keep up the good work

solydzajs commented 12 years ago

I had the same issue. It's related to node-waf and x86_64. node-waf is trying to create i386 binary, but gphoto2 libs that are installed are x86_64. node-waf is not deprecated and node-gyp should be used for module building. I have a bindings.gyp already done. Let me know if you plan to migrate to node-gyp

superunrelated commented 11 years ago

I have the same issue. After having a go at creating a bindings.gyp file I have realized that this is just out of my reach just yet. Can someone please share one that works?

lwille commented 11 years ago

Thanks for your patience guys, I'm very busy with other projects at the moment. Also thanks to @solydzajs for the node-gyp hint!

I just pushed a new version using node-gyp, tested in the following environment:

You can install it via npm, it's bound to node -v 0.8.x I'd be happy if you could confirm a working build, so I can close this issue :) (of course, any build errors are also appreciated).

Feel free to run npm test with an attached camera (I can only test with the 550D (Rebel T2i) and 5D Mark II).

@solydzajs, if your .gyp file is more elaborate, please share it with a pull request.

superunrelated commented 11 years ago

Awesome! Thank you for fixing this.

This now works with my setup:

I ran the tests with a 500D and it mostly worked after upping the timeouts. I think this camera is quite slow since it's slow when I use the command line interface as well.

The tests failed on:

I assume there are some features this camera don't support. I'll continue testing with some other cameras and try and figure out what is failing.

Thanks a lot!

lwille commented 11 years ago

When I built the test, I had a 550D that supports all the settings that are written there, so I should use more generic settings to test it :)

Also, it would be nice if you could add a logging line to "should return a proper error code" to see what the error looks like (I expected it to be a number).

Also, the sending of previews over a socket should fail if your camera doesn't have an EOS Viewfinder ("Live mode").