As an example, we will create camcv, a soft strongly inspired from raspistill. It will allow us later to modify source code and play with OpenCV.
- create a new folder in your home directory and copy all raspicam apps source code.
cd
mkdir camcv
cd camcv
cp /opt/vc/userland/host_applications/linux/apps/raspicam/* .
mv RaspiStill.c camcv.c
Perhaps a chmod is necessary (sudo chmod 777 camcv.c)
2. remove then content of CMakeLists.txt and replace with :
cmake_minimum_required(VERSION 2.8)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c)
target_link_libraries(camcv /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so )
3. delete CMakeFiles directory if it exits
4. Compile & test
cmake .
make
./camcv -t 1000
5. [optional] Clean file. camcv.c is a long file with a lot of useless lines for us. All these following function could be delete (or commented). Remove of course all call to these functions in the remaining code.
static void dump_status(RASPISTILL_STATE *state)
static int parse_cmdline(int argc, const char **argv, RASPISTILL_STATE *state)
static void display_valid_parameters()
static MMAL_STATUS_T add_exif_tag(RASPISTILL_STATE *state, const char *exif_tag)
static void add_exif_tags(RASPISTILL_STATE *state)
static void store_exif_tag(RASPISTILL_STATE *state, const char *exif_tag)
The existing line default_status(&state); avoid you to parse command line using defaults parameters. Just add a line after this one :
state.filename=”foobar.jpg”;
Recompile and retest. Should work.
At this stage you should watch an old good movie with John Wayne.
I used to be suggested this blog by my cousin. I am no longer sure whether
or not this post is written by means of him as nobody else realize
such distinct approximately my difficulty. You are wonderful!
Thank you!
Hello all,
I have followed all the steps as mentioned above. But I am still getting the following error
/home/pi/camcv/RaspiTex.h:37:35: fatal error: interface/khronos/include/EGL/eglext_brcm.h: No such file or directory.
Compilation terminated.
I have gone through all the posts provided here. This issue was discussed earlier. i Followed rileyjenk solution for it but still getting the same error.
Searched out a lot but unable to find any solution.
Can someone please help!!
Edit RaspiTex.h on line 37 to read
#include “/opt/vc/userland/interface/khronos/include/EGL/eglext_brcm.h”
edit as needed for your file location. You will also likely want to edit line 38 (mmal.h include) to a similar location. Mine is:
#include “/opt/vc/userland/interface/mmal/mmal.h”
make[1]: CMakeFiles/Makefile2: No such file or directory
make[1]: *** No rule to make target ‘CMakeFiles/Makefile2’. Stop.
Makefile:133: recipe for target ‘all’ failed
make: *** [all] Error 2
can anybody help???
Hi everybody I have this problem:
In file included from /home/pi/camcv/RaspiTex.h:39:0,
from /home/pi/camcv/camcv.c:77:
/home/pi/camcv/gl_scenes/mirror.h:35:17: error: unknown type name ‘RASPITEX_STATE’
In file included from /home/pi/camcv/RaspiTex.h:40:0,
from /home/pi/camcv/camcv.c:77:
/home/pi/camcv/gl_scenes/sobel.h:35:16: error: unknown type name ‘RASPITEX_STATE’
In file included from /home/pi/camcv/RaspiTex.h:41:0,
from /home/pi/camcv/camcv.c:77:
/home/pi/camcv/gl_scenes/square.h:35:17: error: unknown type name ‘RASPITEX_STATE’
In file included from /home/pi/camcv/RaspiTex.h:42:0,
from /home/pi/camcv/camcv.c:77:
/home/pi/camcv/gl_scenes/teapot.h:33:17: error: unknown type name ‘RASPITEX_STATE’
In file included from /home/pi/camcv/RaspiTex.h:43:0,
from /home/pi/camcv/camcv.c:77:
/home/pi/camcv/gl_scenes/yuv.h:35:14: error: unknown type name ‘RASPITEX_STATE’
CMakeFiles/camcv.dir/build.make:123: recipe for target ‘CMakeFiles/camcv.dir/camcv.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/camcv.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
Any idea?
— Configuring done
— Generating done
— Build files have been written to: /home/pi/camcv
Scanning dependencies of target camcv
[ 7%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
[ 15%] Building C object CMakeFiles/camcv.dir/RaspiCLI.c.o
[ 23%] Building C object CMakeFiles/camcv.dir/RaspiPreview.c.o
[ 30%] Building C object CMakeFiles/camcv.dir/camcv.c.o
[ 38%] Building C object CMakeFiles/camcv.dir/RaspiTex.c.o
[ 46%] Building C object CMakeFiles/camcv.dir/RaspiTexUtil.c.o
[ 53%] Building C object CMakeFiles/camcv.dir/tga.c.o
[ 61%] Building C object CMakeFiles/camcv.dir/gl_scenes/teapot.c.o
[ 69%] Building C object CMakeFiles/camcv.dir/gl_scenes/models.c.o
[ 76%] Building C object CMakeFiles/camcv.dir/gl_scenes/square.c.o
[ 84%] Building C object CMakeFiles/camcv.dir/gl_scenes/mirror.c.o
[ 92%] Building C object CMakeFiles/camcv.dir/gl_scenes/yuv.c.o
[100%] Building C object CMakeFiles/camcv.dir/gl_scenes/sobel.c.o
Linking C executable camcv
/usr/bin/ld: CMakeFiles/camcv.dir/camcv.c.o: undefined reference to symbol ‘sem_post@@GLIBC_2.4’
//lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
CMakeFiles/camcv.dir/build.make:392: recipe for target ‘camcv’ failed
make[2]: *** [camcv] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
Can anyone help ?
I meet same problems,. Do u find ant solutions
Same problem here – any direction would be greatly appreciated
did you find the solution , i have the same problem here 😦
I have same problem, i need help!
…and another one bites the dust…
Solved this problem by adding to CMakeLists.txt this line:
SET(CMAKE_EXE_LINKER_FLAGS “-lpthread”)
But now I get the next reference problems: raspitex_set_defaults, raspitex_configure_preview_port, display_valid_parameters, parse_cmdline, dump_status, raspitex_init, raspitex_start, raspitex_capture, add_exif_tags, raspitex_stop, raspitex_destroy.
I have the same things. I go to the 5th step, delete functions and try to “make” one more time, but result is the same. I try it on raspberry pi B+, Raspbian OS:
Description: Debian GNU/Linux 7.6 (wheezy)
Release: 7.6
Codename: wheezy
Linux raspberrypi 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l GNU/Linux
Hi, here is what I have now, and successfully compiled, I don’t know yet if is all correct, but at least compiled and run well the ./camcv –help
here is my CMakeList.txt
pi@raspberrypi ~/camcv $ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
set (GL_SCENE_SOURCES
gl_scenes/models.c
gl_scenes/mirror.c
gl_scenes/yuv.c
gl_scenes/sobel.c
gl_scenes/square.c
gl_scenes/teapot.c)
include_directories(/opt/vc/include)
include_directories(/opt/vc/include/EGL)
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/home/pi/camcv)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c RaspiTex.c RaspiTexUtil.c tga.c ${GL_SCENE_SOURCES})
#add_executable(raspiyuv ${COMMON_SOURCES} RaspiStillYUV.c)
#add_executable(raspivid ${COMMON_SOURCES} RaspiVid.c)
target_link_libraries(camcv /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so)
#set (MMAL_LIBS mmal_core mmal_util mmal_vc_client)
#target_link_libraries(camcv ${MMAL_LIBS} vcos bcm_host GLESv2 EGL m)
#target_link_libraries(raspiyuv ${MMAL_LIBS} vcos bcm_host)
#target_link_libraries(raspivid ${MMAL_LIBS} vcos bcm_host)
same problem 😦 😦 did anyone find a solution yet?
Awesome I’m stuck at the same place as everyone else, why is it so hard to do this =( it looked so simple for him
hi, thx for sharing. i tired your cmakelist but it keep on report me:
CMake Error at CMakeLists.txt:19 (add_executable):
Cannot find source file:
gl_scenes/models.c
I have checked in gl_source, models.c is just there and i have no idea whats going wrong
Same problem here. any solution?
I’ve also encountered the same problem. Is there any solution?
“/usr/bin/ld: CMakeFiles/camcv.dir/camcv.c.o: undefined reference to symbol ‘sem_post@@GLIBC_2.4′”
I get the same error as this.
As I understang it, the reason is this:
This program needs Libc.
Raspbian is based on Debian which currently uses EGlibc.
I can’t see how we can compile this program without Libc.
Do we need to wait until Debian switches back to Libc, or is there a workaround?
I mean Glibc, not Libc
Hi my problem is :
[ 20%] Building C object CMakeFiles/camcv.dir/Raspitex.c.o
In file included from /home/pi/camcv/RaspiTex.c:29:0:
/home/pi/camcv/RaspiTex.h:33:21: fatal error: EGL/egl.h: Aucun fichier ou dossier de ce type
compilation terminated.
CMakeFiles/camcv.dir/build.make:103: recipe for target ‘CMakeFiles/camcv.dir/RaspiTex.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiTex.c.o} Error 1
CMakeFiles/MakeFile2:63: recipe for taget ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all} Error 2
MakeFile:75: recipe for taget ‘all’ failed
make: *** [all] Error 2
Somebody for help me please
same problem at step 4:
pi@raspberrypi ~/camcv $ make
Scanning dependencies of target camcv
[ 25%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
[ 50%] Building C object CMakeFiles/camcv.dir/RaspiCLI.c.o
[ 75%] Building C object CMakeFiles/camcv.dir/RaspiPreview.c.o
[100%] Building C object CMakeFiles/camcv.dir/camcv.c.o
In file included from /home/pi/camcv/camcv.c:77:0:
/home/pi/camcv/RaspiTex.h:33:21: fatal error: EGL/egl.h: Arquivo ou diretório não encontrado
compilation terminated.
CMakeFiles/camcv.dir/build.make:123: recipe for target ‘CMakeFiles/camcv.dir/camcv.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/camcv.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
any idea? solution?
In point 2. i add the line:
include_directories(/opt/vc/include)
Now i have the error:
Scanning dependencies of target camcv
[ 25%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
[ 50%] Building C object CMakeFiles/camcv.dir/RaspiCLI.c.o
[ 75%] Building C object CMakeFiles/camcv.dir/RaspiPreview.c.o
[100%] Building C object CMakeFiles/camcv.dir/camcv.c.o
Linking C executable camcv
/usr/bin/ld: CMakeFiles/camcv.dir/camcv.c.o: undefined reference to symbol ‘sem_post@@GLIBC_2.4’
//lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
CMakeFiles/camcv.dir/build.make:165: recipe for target ‘camcv’ failed
make[2]: *** [camcv] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
any idea? solution?
Check this to compile raspi camcv https://github.com/robidouille/robidouille/tree/master/raspicam_cv
This one is great but i was not able to do following steps.
Using the static library
Add the include path
-I$(HOME)/git/robidouille/raspicam_cv
Link with the raspicamcv library
-L$(HOME)/git/robidouille/raspicam_cv -lraspicamcv
Link with the userland libraries:
-L$(HOME)/git/raspberrypi/userland/build/lib -lmmal_core -lmmal -l mmal_util -lvcos -lbcm_host
how to do this step??? Do i need to add anything in CMakeLists.txt?
i failed this step(sudo make) and cannot find the solution , plx help !
Makefile:5 ../Makefile.include: no such file or directory
so i find in the directory /home/camcv/ ,
there isn’t any file named Makefile.include
There is only the file named Makefile which the line 5 is “include ../Makefile.include”
Hi, I was abe to compile raspicam_cv but still errors here while compiling camcv. Can anyone who succeeded to compile camcv display the values of the PATH variable here.
I resolved this problem.
Messages says “I can’t find the link to sem_*”.
the “sem_*” is the lib of pthread,
(c.f. http://askubuntu.com/questions/521706/error-adding-symbols-dso-missing-from-command-line-while-compiling-g13-driver)
In my case, this message was output
“CMakeFiles/camcv.dir/build.make:181: recipe for target ‘camcv’ failed” .
Around “CMakeFiles/camcv.dir/build.make:181” is
180 camcv: CMakeFiles/camcv.dir/link.txt
181 @$(CMAKE_COMMAND) -E cmake_echo_color –switch=$(COLOR) –red –bold “Linking CXX executable camcv”
182 $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/camcv.dir/link.txt –verbose=$(VERBOSE)
So I added “,-lpthread” end of “CMakeFiles/camcv.dir/link.txt”
This is example :
/usr/bin/c++ CMakeFiles/camcv.dir/RaspiCamControl.c.o CMakeFiles/camcv.dir/RaspiCLI.c.o CMakeFiles/camcv.dir/RaspiPreview.c.o CMakeFiles/camcv.dir/camcv_vid1.cpp.o -o camcv -rdynamic -L/opt/vc/libfacerec /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/libfacerec/libopencv_facerec.a -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_ts -lopencv_video -lopencv_videostab -Wl,-rpath,/opt/vc/libfacerec:/opt/vc/lib,-lpthread
/usr/bin/ld.bfd.real: CMakeFiles/camcv.dir/camcv.c.o: undefined reference to symbol ‘sem_post@@GLIBC_2.4’
//lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
CMakeFiles/camcv.dir/build.make:392: recipe for target ‘camcv’ failed
make[2]: *** [camcv] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
help!!!TT
I was able to get it to compile using this CMakeLists.txt (modified from p431i7o), ensure the quotation marks in lpthread line are ordinary as sometimes they are automatically converted when making a post:
cmake_minimum_required(VERSION 2.8)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
set (GL_SCENE_SOURCES
gl_scenes/models.c
gl_scenes/mirror.c
gl_scenes/yuv.c
gl_scenes/sobel.c
gl_scenes/square.c
gl_scenes/teapot.c)
SET(CMAKE_EXE_LINKER_FLAGS “-lpthread”)
include_directories(/opt/vc/include)
include_directories(/opt/vc/include/EGL)
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/home/pi/camcv)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c RaspiTex.c RaspiTexUtil.c tga.c ${GL_SCENE_SOURCES})
target_link_libraries(camcv m /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so)
make not work:
pi@raspberrypi ~/camcv $ sudo cmake .
— The C compiler identification is GNU 4.6.3
— The CXX compiler identification is GNU 4.6.3
— Configuring done
— Generating done
— Build files have been written to: /home/pi/camcv
pi@raspberrypi ~/camcv $ sudo make
Scanning dependencies of target camcv
[ 7%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
[ 15%] Building C object CMakeFiles/camcv.dir/RaspiCLI.c.o
[ 23%] Building C object CMakeFiles/camcv.dir/RaspiPreview.c.o
[ 30%] Building C object CMakeFiles/camcv.dir/camcv.c.o
[ 38%] Building C object CMakeFiles/camcv.dir/RaspiTex.c.o
[ 46%] Building C object CMakeFiles/camcv.dir/RaspiTexUtil.c.o
[ 53%] Building C object CMakeFiles/camcv.dir/gl_scenes/teapot.c.o
[ 61%] Building C object CMakeFiles/camcv.dir/gl_scenes/models.c.o
[ 69%] Building C object CMakeFiles/camcv.dir/gl_scenes/square.c.o
[ 76%] Building C object CMakeFiles/camcv.dir/gl_scenes/mirror.c.o
[ 84%] Building C object CMakeFiles/camcv.dir/gl_scenes/yuv.c.o
[ 92%] Building C object CMakeFiles/camcv.dir/gl_scenes/sobel.c.o
[100%] Building C object CMakeFiles/camcv.dir/tga.c.o
Linking C executable camcv
/usr/bin/ld: CMakeFiles/camcv.dir/gl_scenes/models.c.o: undefined reference to symbol ‘sqrtf@@GLIBC_2.4’
//lib/arm-linux-gnueabihf/libm.so.6: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
CMakeFiles/camcv.dir/build.make:392: recipe for target ‘camcv’ failed
make[2]: *** [camcv] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
pi@raspberrypi ~/camcv $
I get the exact same error. specifically
“undefined reference to symbol ‘sqrtf@@GLIBC_2.4′”
any help would be greatly appreciated!
This is my makelist that is successfully compiled.
cmake_minimum_required(VERSION 2.8)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
set (GL_SCENE_SOURCES
gl_scenes/models.c
gl_scenes/mirror.c
gl_scenes/yuv.c
gl_scenes/sobel.c
gl_scenes/square.c
gl_scenes/teapot.c)
SET(CMAKE_EXE_LINKER_FLAGS “-lpthread”)
include_directories(/home/pi/camcv/raspicam/gl_scenes)
include_directories(/opt/vc/include)
include_directories(/opt/vc/include/EGL)
include_directories(/opt/vc/userland-master/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/home/pi/camcv)
include_directories(/home/pi/camcv/raspicam)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c RaspiTex.c RaspiTexUtil.c tga.c ${GL_SCENE_SOURCES})
target_link_libraries(camcv m /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so)
This work for me too, Thankssss.
Hello, i tried this list but at the end of compilation i get as
cc:error: “-lpthread”: no such file or directory
please help
https://thinkrpi.wordpress.com/2013/05/22/opencvpi-cam-step-3-create-your-own-project/
hello everybody
I compiled raspicam successfully
but as I compiled camcv, I got this error, what should I do?
/home/pi/camcv/RaspiTex.h:33:21: fatal error: EGL/egl.h: No such file or directory
compilation terminated.
I solved last probem but now I get this error:
libmmal_core.so not recognized
what would be the problem?
How did you solve the problem of EGL/egl.h?
Copying the content of /opt/vc/userland/interface/khronos/include to /usr/include should do the trick. Try:
sudo cp –r /opt/vc/userland/interface/khronos/include/* /usr/include
I changed the following lines in the file RaspiText.h and it worked:
#include
#include
But I also had to change the CMakeLists.txt to the ones proposed.
This were the lines to change in RaspiText.h:
#include \
#include \
I cant edit or delete my own coments. it doesnt show what I wrote. You just have to delete “EGL/” from the first two includes, leaving them just like “egl.h” and “eglext.h”
“…/usr/bin/ld: CMakeFiles/camcv.dir/gl_scenes/models.c.o: undefined reference to symbol ‘sqrtf@@GLIBC_2.4′…”
For anyone getting this message, it means the linker was unable to resolve the floating square root function used in models.c file. What you will need to do is to add “-lm” linker flag during compilation. I suggest adding it to the “-lpthread” linker flag already suggested by others in the line:
SET(CMAKE_EXE_LINKER_FLAGS “-lpthread -lm”)
That should take care of the problem and be able to compile successfully.
Worked out for me ! Thanks 🙂
I have a problem. I take this error message.
— Configuring done
CMake Error at CMakeLists.txt:23 (add_executable):
Cannot find source file:
gl_scenes/models.c
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
— Build files have been written to: /home/pi/camcv
can anyone help me?
My error is here:
pi@raspberrypi ~/camcv $ cmake .
— The C compiler identification is GNU 4.6.3
— The CXX compiler identification is GNU 4.6.3
— Configuring done
— Generating done
— Build files have been written to: /home/pi/camcv
pi@raspberrypi ~/camcv $ make
Scanning dependencies of target camcv
[ 25%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
/home/pi/camcv/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:57: recipe for target ‘CMakeFiles/camcv.dir/RaspiCamControl.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.c.o] Error 1
CMakeFiles/Makefile2:63: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:75: recipe for target ‘all’ failed
make: *** [all] Error 2
I cannot get past the ‘make’ step becuase it says no such file or directory for “interface/vcox/vcox.h”
Can anyone assist with this?
edit target link as :
target_link_libraries(camcv /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so libpthread.so libm.so)
then
cmake .
make
thank you, it’s mean:
camcv# cmake
camcv# make
it doesn’t work
Yup it didnt worked. 😦
hello all,
need help stuck at this from a long time..
after i did make it showed warning:
clock skew detected. your build may be incomplete.
[100%] built target camcv
when I try to run ./camcv -t 1000
i get the following error
mmal: mmal_vc_component_create: failed to create component ‘vc.ril.camera’ (1:ENOEM)
mmal: Camera not detected. please check carefully the camera module is installed correctly
I tried everything, touch to remove clock skew checked raspistill and vid they work, enabled the raspicam using raspi-config but unable to detect the cause. please help.
urgently needed.
thank you!
I’m getting an error after make
[ 25%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
/home/pi/camcv/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:57: recipe for target ‘CMakeFiles/camcv.dir/RaspiCamControl.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.c.o] Error 1
CMakeFiles/Makefile2:63: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:75: recipe for target ‘all’ failed
make: *** [all] Error 2
Please help…
I get this error when I call make :
make
[ 25%] Building C object CMakeFiles/camcv.dir/camcv.c.o
In file included from /home/pi/camcv/camcv.c:77:0:
/home/pi/camcv/RaspiTex.h:150:4: error: unknown type name ‘EGL_DISPMANX_WINDOW_T’
CMakeFiles/camcv.dir/build.make:123: recipe for target ‘CMakeFiles/camcv.dir/camcv.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/camcv.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
Any idea ?
Hi I have same error, do u find ant solutions ???
HI! I’m new to all of this and I’m getting an error when entering the following command:
cp /opt/vc/userland/host_applications/linux/apps/raspicam/* .
mv RaspiStill.c camcv.c
cp: target ‘camcv.c’ is not a directory
Don’t know why it says that, can anyone please help me?
It’s two different commands. Firstly, enter the first one. Then enter the second one…
are you executing all that on the same line?
because mv RaspiStill.c camcv.c is only a commando to rename the file to camcv.c
And the error message says that camcv.c is not a directory, as if you are trying to copy all with the previous cp command.
Getting the following error when entering make
In file included from /home/pi/camcv/camcv.c:77:0:
/home/pi/camcv/RaspiTex.h:33:21: fatal error: EGL/egl.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:123: recipe for target ‘CMakeFiles/camcv.dir/camcv.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/camcv.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
does anyone know how to get this to work? I’m relatively new to all of this
thanks
In step 2 from which folder do we have to edit the contents of CMakeLists.txt?
We are getting this error after point 2 of step 3.
pi@raspberrypi ~/camcv/raspicam $ make
Scanning dependencies of target camcv
make[2]: Warning: File ‘RaspiCamControl.c’ has modification time 2439679 s in the future
[ 25%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
/home/pi/camcv/raspicam/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:57: recipe for target ‘CMakeFiles/camcv.dir/RaspiCamControl.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.c.o] Error 1
CMakeFiles/Makefile2:63: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:75: recipe for target ‘all’ failed
make: *** [all] Error 2
Please help.
We are getting this error
pi@raspberrypi ~/camcv/raspicam $ make
Scanning dependencies of target camcv
make[2]: Warning: File ‘RaspiCamControl.c’ has modification time 2434253 s in the future
[ 10%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
[ 20%] Building C object CMakeFiles/camcv.dir/RaspiCLI.c.o
[ 30%] Building C object CMakeFiles/camcv.dir/RaspiPreview.c.o
[ 40%] Building C object CMakeFiles/camcv.dir/camcv.c.o
[ 50%] Building C object CMakeFiles/camcv.dir/RaspiTex.c.o
In file included from /home/pi/camcv/raspicam/RaspiTex.c:47:0:
/home/pi/camcv/raspicam/gl_scenes/mirror.h:33:22: fatal error: RaspiTex.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:149: recipe for target ‘CMakeFiles/camcv.dir/RaspiTex.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiTex.c.o] Error 1
CMakeFiles/Makefile2:63: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:75: recipe for target ‘all’ failed
make: *** [all] Error 2
I am on a Raspberry Pi 2 with NOOBs Raspian and finally got this to work after a long time of sorting through all these comments on errors people had and trying different things. Maybe this will help someone out.
I primarily used the method from 王毅博 and added “pthread” and “-lm” at the end of target_link_libraries. I ended up deleting the whole camcv folder and starting over a few times so I recommend deleting that folder and copying it fresh using “sudo” and “-r” in your cp command because otherwise it would not copy in the gl_scenes folder.
Process:
cd ~
mkdir camcv
//while in camcv folder
sudo cp -r /opt/vc/userland/host_applications/linux/apps/raspicam/* .
//Delete everything in CMakeLists.txt and add:
//Note the “pthread” and “-lm” at the end of target_link_libraries
cmake_minimum_required(VERSION 2.8)
project(camcv)
SET(COMPILE_DEFINITIONS -Werror)
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/host_applications/linux/apps/raspicam/gl_scenes)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/opt/vc/userland/interface/khronos/include)
include_directories(/opt/vc/userland/interface/khronos/common)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c RaspiTex.c RaspiTexUtil.c tga.c gl_scenes/teapot.c gl_scenes/models.c gl_scenes/square.c gl_scenes/mirror.c gl_scenes/yuv.c gl_scenes/sobel.c)
target_link_libraries(camcv /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so pthread -lm)
//copy RaspiTex.h and RaspiTexUtil.h file to the gl_scenes folder.
cp RaspiTex.h /gl_scenes/RaspiTex.h
cp RaspiUtilTex.h /gl_scenes/RaspiTexUtil.h
//Change the RaspTex.c include define.
#include “./gl_scenes/mirror.h”
#include “./gl_scenes/sobel.h”
#include “./gl_scenes/square.h”
#include “./gl_scenes/teapot.h”
#include “./gl_scenes/yuv.h”
//I then used:
sudo cmake .
sudo make
Thanks, brad.
Your instructions work just fine on RPI2.
Hi Brad
After trying a lot I followed ur step but again it didn’t work. I am using Raspberry pi 2 with raspicam. following is the error msg I am getting on compiling.
pi@raspberrypi ~/camcv $ sudo make
Scanning dependencies of target camcv
[ 7%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
/home/pi/camcv/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No s uch file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:57: recipe for target ‘CMakeFiles/camcv.dir/Rasp iCamControl.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.c.o] Error 1
CMakeFiles/Makefile2:63: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:75: recipe for target ‘all’ failed
make: *** [all] Error 2
pi@raspberrypi ~/camcv $
Please check If you could help me out with this. I am trying to interface cam since 2 months now.
Warm Regards
Amit
I was able to compile it…………!!!!!!!
the issue was my the folder “userland” used here is named as “userland-master” so I changed the name at all the places and it worked. I could have renamed the folder itself but anyway now its compiled.
🙂
I am glad you figured it out!
Hey brad
i found error while copying
//copy RaspiTex.h and RaspiTexUtil.h file to the gl_scenes folder.
cp RaspiTex.h /gl_scenes/RaspiTex.h
cp: accessing ‘/gl_scenes/RaspiTex.h’: is not a directory
i do have directory named gl_scenes. please help. same happens with secong copy command.
Hey Kevin u can use the following syntax.
cd /opt/vc/
cp RaspiTex.h /gl_scenes
cp RaspiUtilTex.h /gl_scenes
I am not sure if u need ‘/’ as currently I am not having the hardware to test but I also faced the same issue and that got it solved. I am now stuck in the next step
https://thinkrpi.wordpress.com/2013/05/22/opencvpi-cam-step-4-link-with-opencv/
interfacing with open cv. I have already installed OpenCv 2.4.9. In that again you have to change this file.
Regards
Amit
Hello Amit, i tried what you have mentioned as follows
sudo su
cd /opt/vc/
cp RaspiTex.h /gl_scenes
error: no such file or directory
but still i’m unable to copy it, please help me out
YOU are a lifesaver! thank you!
amigo un favor le hago tal cual esta en las instrucciones pero me sale esto
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 2.8)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run “cmake –help-policy CMP0000”.
This warning is for project developers. Use -Wno-dev to suppress it.
— Configuring done
CMake Error at CMakeLists.txt:11 (add_executable):
Cannot find source file:
camcv.c
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
— Build files have been written to: /home/pi/camcv
Y SI LE HAGO EL MAKE ME SALE ESTO
/home/pi/camcv/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No existe el fichero o el directorio
compilation terminated.
CMakeFiles/camcv.dir/build.make:54: recipe for target ‘CMakeFiles/camcv.dir/RaspiCamControl.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
I run this code .. My code of CMakeLists.txt is…..
cmake_minimum_required(VERSION 2.8)
SET(CMAKE_EXE_LINKER_FLAGS “-lpthread”)
PROJECT( camcv )
FIND_PACKAGE (OpenCV REQUIRED)
SET(COMPILE_DEFINITIONS -Werror)
include_directories(/opt/vc/include)
include_directories(/opt/vc/include/EGL)
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/host_applications/linux/apps/raspicam/gl_scenes)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/opt/vc/userland/interface/khronos/include)
include_directories(/opt/vc/userland/interface/khronos/common)
include_directories(./gl_scenes)
include_directories(.)
ADD_EXECUTABLE(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c RaspiTex.c RaspiTexUtil.c tga.c gl_scenes/teapot.c gl_scenes/models.c gl_scenes/square.c gl_scenes/mirror.c gl_scenes/yuv.c gl_scenes/sobel.c)
TARGET_LINK_LIBRARIES(camcv /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so libpthread.so libm.so pthread -lm ${OPENCV_LIBS})
Hi Brad!!! I have a problem HELP ME PLEASE!!!
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 2.8)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run “cmake –help-policy CMP0000”.
This warning is for project developers. Use -Wno-dev to suppress it.
— Configuring done
CMake Error at CMakeLists.txt:11 (add_executable):
Cannot find source file:
camcv.c
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
— Build files have been written to: /home/pi/camcv
WITH THE MAKE
/home/pi/camcv/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No existe el fichero o el directorio
compilation terminated.
CMakeFiles/camcv.dir/build.make:54: recipe for target ‘CMakeFiles/camcv.dir/RaspiCamControl.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
Hi , Sooper brad you are. Great. It works for me. 100%…. 🙂
Thanks. When come to “//Delete everything in CMakeLists.txt and add:”, I open the CmakeLists.txt with Geany and add, when save, it give me an error window, says “error saving file. permission denied….” Any suggestion sir?
Hello everyone,
I try to do steps of face recognition with my friend but we stack third step. We have errors, How can we solve this problem. Please Help us
Scanning dependencies of target camcv
[ 25%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
[ 50%] Building C object CMakeFiles/camcv.dir/RaspiCLI.c.o
[ 75%] Building C object CMakeFiles/camcv.dir/RaspiPreview.c.o
[100%] Building C object CMakeFiles/camcv.dir/camcv.c.o
In file included from /home/pi/camcv/camcv.c:77:0:
/home/pi/camcv/RaspiTex.h:33:21: fatal error: EGL/egl.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:126: recipe for target ‘CMakeFiles/camcv.dir/camcv.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/camcv.c.o] Error 1
CMakeFiles/Makefile2:63: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:75: recipe for target ‘all’ failed
make: *** [all] Error 2
hi there,
there you have lot of steps to follow. I had the same error. change the cmakefiles.txt and RaspiTex.h files.
-cmakefiles.txt-
cmake_minimum_required(VERSION 2.8)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
include_directories(/opt/vc/userland/include/EGL/)
include_directories(/opt/vc/userland/include/GLES/)
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c)
target_link_libraries(camcv /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so )
Now change the lines 33 to 36 in RaspiTex.h as follows.
#include
#include
#include
#include
Then correct the code as mentioned in step 5 above. you would have to delete/comment few code parts in ‘camcv.c’.
Sorry that the includes are missing. 😉
#include
#include
#include
#include
remove their folder paths, sorry that I can’t copy paste the code. I tried it didn’t work 😦
hatayı dosyalar için belirttiğin yolların eksik olmasından veriyor. benim yaptığım şu şekilde ve çalışıyor. İt is ok.
cmake_minimum_required(VERSION 2.8)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
set (GL_SCENE_SOURCES
gl_scenes/models.c
gl_scenes/mirror.c
gl_scenes/yuv.c
gl_scenes/sobel.c
gl_scenes/square.c
gl_scenes/teapot.c)
SET(CMAKE_EXE_LINKER_FLAGS “-lpthread”)
include_directories(/home/pi/camcv/raspicam/gl_scenes)
include_directories(/home/pi/opt/vc/userland/interface/khronos/include)
include_directories(/home/pi/opt/vc/userland/interface/khronos/include/EGL)
include_directories(/home/pi/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/home/pi/opt/vc/userland/interface/vcos)
include_directories(/home/pi/opt/vc/userland)
include_directories(/home/pi/opt/vc/userland/interface/vcos/pthreads)
include_directories(/home/pi/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/home/pi/camcv)
include_directories(/home/pi/camcv/raspicam)
add_executable(camcv
RaspiCamControl.c
RaspiCLI.c
RaspiPreview.c
camcv.c
RaspiTex.c
RaspiTexUtil.c
tga.c ${GL_SCENE_SOURCES})
target_link_libraries(camcv m
/home/pi/opt/vc/userland/build/lib/libmmal_core.so
/home/pi/opt/vc/userland/build/lib/libmmal_util.so
/home/pi/opt/vc/userland/build/lib/libmmal_vc_client.so
/home/pi/opt/vc/userland/build/lib/libvcos.so
/home/pi/opt/vc/userland/build/lib/libbcm_host.so
/home/pi/opt/vc/userland/build/lib/libGLESv2.so
/home/pi/opt/vc/userland/build/lib/libEGL.so)
Pingback: class10_final assignment_04/06 | peixinfu
when I do command:
cmake_minimum_required(VERSION 2.8)
it writes:
bash: syntax error near unexepted token ‘VERSION’
any ideas?
ignore my comment 😀
funciono para mi
cmake_minimum_required(VERSION 2.8)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
set (GL_SCENE_SOURCES
gl_scenes/models.c
gl_scenes/mirror.c
gl_scenes/yuv.c
gl_scenes/sobel.c
gl_scenes/square.c
gl_scenes/teapot.c)
#SET(CMAKE_EXE_LINKER_FLAGS “-lpthread”)
include_directories(/home/pi/camcv/raspicam/gl_scenes)
include_directories(/opt/vc/include)
include_directories(/opt/vc/include/EGL)
include_directories(/opt/vc/userland-master/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/home/pi/camcv)
include_directories(/home/pi/camcv/raspicam)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c RaspiTex.c RaspiTexUtil.c tga.c ${GL_SCENE_SOURCES})
target_link_libraries(camcv /opt/vc/lib/libmmal_core.so
/opt/vc/lib/libmmal_util.so
/opt/vc/lib/libmmal_vc_client.so
/opt/vc/lib/libvcos.so
/opt/vc/lib/libbcm_host.so
/opt/vc/lib/libGLESv2.so
/opt/vc/lib/libEGL.so libpthread.so libm.so)
Thanks! This worked for me as well!!
i’m trying to test an example using the raspberry pi camera board with opencv the code is from https://github.com/robidouille/robidouille/blob/master/raspicam_cv/RaspiCamCV.c
when typying make i get the error : undefined reference to symbol ‘cvSaveImage’
i have the header that contain the fonction cvSaveImage when i d’ont use cvSaveImage it compile successfully plz help 🙂
how to do step 5 [optional] Clean file. camcv.c is a long file with a lot of useless lines for us. All these following function could be delete (or commented). Remove of course all call to these functions in the remaining code.
Hello guys!
Could you help me please with first step. where could I find camcv file? It is not in raspicam directory
hi, i got nothing in cp /opt/vc/userland/ how can i solve it? Thank you
I meant, I’ve done pt2 with no content in /opt/vc/userland/ it’s gonna be a problem?
Here’s my cmakelists.txt code, it’s working !
cmake_minimum_required(VERSION 3.0)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
set (GL_SCENE_SOURCES
gl_scenes/models.c
gl_scenes/mirror.c
gl_scenes/yuv.c
gl_scenes/sobel.c
gl_scenes/square.c
gl_scenes/teapot.c)
SET(CMAKE_EXE_LINKER_FLAGS ‘-lpthread’)
include_directories(/opt/vc/include)
include_directories(/opt/vc/include/EGL)
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/home/pi/camcv)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c RaspiTex.c RaspiTexUtil.c tga.c ${GL_SCENE_SOURCES})
target_link_libraries(camcv m /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so)
~
Hi, may I ask how you did this step? is it just open the cmakelists.txt and add these codes? but if i do this always says permission denied, any help thanks.
can i use webcam instead of rasp cam,?
Yes of course. Look at others post in this blog (magic mirror)
/home/pi/camcv/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:54: recipe for target ‘CMakeFiles/camcv.dir/RaspiCamControl.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
PLEASE HELP! After typing make, I am getting:
/home/pi/camcv/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:54: recipe for target ‘CMakeFiles/camcv.dir/RaspiCamControl.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
Copy cmakelists.txt code of Wira ( December 21, 2015 at 10:34 am)
Warning types of quotes :
SET(CMAKE_EXE_LINKER_FLAGS ‘-lpthread’)
rewrite the quotes and save .
Run
it’s work !
Pingback: Robot Humidifier using Raspberry Pi - fupeixin
Hi,
I am trying to control raspberry pi cam from opencv. I am using this webpage for instructions:
https://thinkrpi.wordpress.com/2013/05/ … nt-page-2/
After typing make at step 4, I am getting the following error:
/home/pi/camcv/RaspiCamControl.c:33:33: fatal error: interface/vcos/vcos.h: No such file or directory
compilation terminated.
CMakeFiles/camcv.dir/build.make:54: recipe for target ‘CMakeFiles/camcv.dir/RaspiCamControl.c.o’ failed
make[2]: *** [CMakeFiles/camcv.dir/RaspiCamControl.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:72: recipe for target ‘all’ failed
make: *** [all] Error 2
Can anybody please help me? Thanks a lot
regards,
ravishankarkm
Hello
I’m getting this error and can’t figure out what can be. Anyone can help ?
pi@raspberrypi:/home $ sudo make
Scanning dependencies of target camcv
make[2]: Warning: File ‘/opt/vc/interface/mmal/mmal_clock.h’ has modification time 2749 s in the future
[ 14%] Building C object CMakeFiles/camcv.dir/RaspiCamControl.c.o
[ 28%] Building C object CMakeFiles/camcv.dir/RaspiCLI.c.o
[ 42%] Building C object CMakeFiles/camcv.dir/RaspiPreview.c.o
[ 57%] Building C object CMakeFiles/camcv.dir/camcv.c.o
[ 71%] Building C object CMakeFiles/camcv.dir/RaspiTex.c.o
[ 85%] Building C object CMakeFiles/camcv.dir/RaspiTexUtil.c.o
[100%] Building C object CMakeFiles/camcv.dir/tga.c.o
Linking C executable camcv
/usr/bin/ld: cannot open output file camcv: Is a directory
collect2: error: ld returned 1 exit status
CMakeFiles/camcv.dir/build.make:242: recipe for target ‘camcv’ failed
make[2]: *** [camcv] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:76: recipe for target ‘all’ failed
make: *** [all] Error 2
pi@raspberrypi:/home $
Hey, I have hit nearly every error and am now in a similar position as sparkgo. the error i’m seeing after i run make is:
/user/bin/ld: cannot find -llism
so, I am not sure what package i am supposed to download or what and haven’t found anything else through googling. The full outptut is:
Linking C executable camcv
/usr/bin/ld: cannot find -llism
collect2: error: ld return 1 exit status
CMakeFiles/camcv.dir/build.make242: recipe for target ‘camcv’ failed
make[2]: *** [camcv] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
MakeFile:76: recipe for target ‘all’ failed
make: *** [all] Error 2
Any help would be appreciated greatly,
Thanks
I dont know if people are still attempting this but I have been working through this and got camcv to build after modifying the CMakeLists.txt file a bit. My problem is when i run the command ./camcv -t 1000 i get the following errors:
mmal: Unable to set JPEG restart interval
mmal: main: Failed to create encode component
mmal: Failed to run camera app. Please check for firmware updates.
Has anyone else seen this and fixed it? Can anyone please help? Thanks.
Anyone have an idea why i have this error message please?
CMakeFiles/camcv.dir/camcv.c.o: In function `encoder_buffer_callback’:
camcv.c:(.text+0x1ef0): undefined reference to `cvCreateMat’
camcv.c:(.text+0x1f10): undefined reference to `cvDecodeImage’
camcv.c:(.text+0x1f24): undefined reference to `cvSaveImage’
camcv.c:(.text+0x1f30): undefined reference to `cvNamedWindow’
camcv.c:(.text+0x1f3c): undefined reference to `cvShowImage’
camcv.c:(.text+0x1f44): undefined reference to `cvWaitKey’
collect2: error: ld returned 1 exit status
CMakeFiles/camcv.dir/build.make:392: recipe for target ‘camcv’ failed
make[2]: *** [camcv] Error 1
CMakeFiles/Makefile2:60: recipe for target ‘CMakeFiles/camcv.dir/all’ failed
make[1]: *** [CMakeFiles/camcv.dir/all] Error 2
Makefile:76: recipe for target ‘all’ failed
make: *** [all] Error 2
The Userland repository has changed every year and the makefile is very confused. Like everyone else in this place, I’ve met with a lot of mistakes. Here are the CMakefilelists.txt working for me;
cmake_minimum_required(VERSION 2.8)
project( camcv )
SET(COMPILE_DEFINITIONS -Werror)
include_directories(/opt/vc/userland-master/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland-master/host_applications/linux/libs/sm)
include_directories(/home/pi/camcv)
include_directories(/opt/vc/userland-master/interface/vcos)
include_directories(/opt/vc/userland-master)
include_directories(/opt/vc/userland-master/interface/vcos/pthreads)
include_directories(/opt/vc/userland-master/interface/vmcs_host/linux)
include_directories(/opt/vc/userland-master/interface/khronos/include)
set (GL_SCENE_SOURCES
gl_scenes/models.c
gl_scenes/mirror.c
gl_scenes/yuv.c
gl_scenes/sobel.c
gl_scenes/square.c
gl_scenes/teapot.c
gl_scenes/vcsm_square.c)
set (COMMON_SOURCES
RaspiCamControl.c
RaspiCLI.c
RaspiPreview.c)
add_executable(camcv ${COMMON_SOURCES} RaspiTex.c RaspiTexUtil.c tga.c ${GL_SCENE_SOURCES} camcv.c)
target_link_libraries(camcv /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libvcsm.so libpthread.so /opt/vc/lib/libbrcmEGL.so /opt/vc/lib/libbrcmGLESv2.so libm.so)