QuickCam Team Forums

Full Version: cross compile error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to compile libwebcam for a gumstix computer, which uses open embedded on arm. I got the latest version of cmake , created a toolchain file and ran cmake in the build directory. All seems well. Then when I run make, I get this error:

Code:
Scanning dependencies of target webcam
[ 16%] Building C object Libs/libwebcam/CMakeFiles/webcam.dir/libwebcam.o
[ 33%] Building C object Libs/libwebcam/CMakeFiles/webcam.dir/dynctrl.o
In file included from /home/randall/downloads/tarballs/libwebcam-0.1.1/Libs/libwebcam/dynctrl.c:43:
/home/randall/downloads/tarballs/libwebcam-0.1.1/Libs/libwebcam/libwebcam.h:131: error: ‘NAME_MAX’ undeclared here (not in a function)
make[2]: *** [Libs/libwebcam/CMakeFiles/webcam.dir/dynctrl.o] Error 1
make[1]: *** [Libs/libwebcam/CMakeFiles/webcam.dir/all] Error 2
make: *** [all] Error 2


I'm not sure what's the root of the problem here. Any idea?

Randall

I've never tried to compile it for the ARM architecture but the error sounds a little odd. NAME_MAX should be defined in limits.h which is included from dynctrl.c. Could you check whether that's indeed the case on your system?

mrubli Wrote:
I've never tried to compile it for the ARM architecture but the error sounds a little odd. NAME_MAX should be defined in limits.h which is included from dynctrl.c. Could you check whether that's indeed the case on your system?


You were right. I did get it to compile and it seems to work fine. uvcdynctrl tilt, pan etc work so that's great. However, I had to hardcode NAME_MAX in libwebcam.c. There was another file called limits.h in my CMAKE_FIND_ROOT_PATH (~/gumstix/gumstix-oe/tmp/cross/arm-angstrom-linux-gnueabi) and the one I needed was under a "include/linux" subdirectory. I couldn't figure how to set CMAKE_FIND_ROOT_PATH so that it would pick up the right one. I'm using the stable version of libwebcam 0.1.1 with revision 178 of the uvc driver.

BTW, Thanks for your help and thanks to Logitech for being actively involved with the open source community. I already liked your hardware, but now I'll prefer it for myself and for others I buy for or recommend to.

Randall

Glad to hear you got it resolved. There's some useful information on setting CMAKE_FIND_ROOT_PATH here:

CMake Cross Compiling

You may be able to set the path by executing cmake like this:

cmake -DCMAKE_FIND_ROOT_PATH=some/path ..
Reference URL's