Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

install OpenCV & compile C Program using gcc

As part of a bigger Project I am working on, I need to use the OpenCV library on a C Program. I installed opencv and opencv-devel using yum in Fedora 17 32bit. I instructed the preprocessor to import opencv/cv.h and opencv/highgui.h, as the necessary header files. As I've mentioned in the Thread Title, gcc is used to compile the whole C Project. However, there seems to be a problem with the linker. Whenever I try to compile the project, I get a list of errors, similar to:

/tmp/ccNsvLXW.o: In function 'cvRound': opencv.c:(.text+0x19): undefined reference to 'lrint' ...

I've been trying to find a solution, but nothing seems to fix the problem. In the OpenCV Documentation, they mention a different way of installing the Libraries needed, but I don't really understand the steps I have to follow. I thought that Fedora devel Packages where compiled and ready to use. Anyway, if this is the Problem, is there an easy way to make the whole thing work? I've been Coding in Visual Basic for 6 years now, but I've just started learning C as part of my University Education; thus I am not very experienced in manipulating gcc. :(

Any help is appreciated! Thanks in Advance!!! :D

PS: I know this Post is not completely relevant to this Forum, but I need specific instructions for the Fedora Linux Distribution. That's why I posted here... :)

install OpenCV & compile C Program using gcc

As part of a bigger Project I am working on, I need to use the OpenCV library on a C Program. I installed opencv and opencv-devel using yum in Fedora 17 32bit. I instructed the preprocessor to import opencv/cv.h and opencv/highgui.h, as the necessary header files. As I've mentioned in the Thread Title, gcc is used to compile the whole C Project. However, there seems to be a problem with the linker. Whenever I try to compile the project, I get a list of errors, similar to:

/tmp/ccNsvLXW.o: In function 'cvRound': 'cvRound':

opencv.c:(.text+0x19): undefined reference to 'lrint' 'lrint'

...

I've been trying to find a solution, but nothing seems to fix the problem. In the OpenCV Documentation, they mention a different way of installing the Libraries needed, but I don't really understand the steps I have to follow. I thought that Fedora devel Packages where compiled and ready to use. Anyway, if this is the Problem, is there an easy way to make the whole thing work? I've been Coding in Visual Basic for 6 years now, but I've just started learning C as part of my University Education; thus I am not very experienced in manipulating gcc. :(

Any help is appreciated! Thanks in Advance!!! :D

PS: I know this Post is not completely relevant to this Forum, but I need specific instructions for the Fedora Linux Distribution. That's why I posted here... :)