'Can we compile both OpenCv-3.3.0 and GTK+3 with gcc using C code?

I was looking for a C processing image library and find out that OpenCV library was the most convenient (According to people advices). So I decided to install the latest version, but when I tried to include it to my existing GTK+ (C) project, it gave me compiling errors :

undefined reference to cvRound

Exact message is :

$ gcc ./bin/app.o \ 
    $(pkg-config --libs glib-2.0) \
    $(pkg-config --libs pango) \
    $(pkg-config --libs gtk+-3.0) \
    $(pkg-config --libs gmodule-2.0) \
    $(pkg-config --libs opencv) -o bin/app

./bin/app.o : Dans la fonction « cvPointFrom32f » :
app.c:(.text+0x557) : référence indéfinie vers « cvRound »
app.c:(.text+0x56d) : référence indéfinie vers « cvRound »
./bin/app.o : Dans la fonction « cvReadInt » :
app.c:(.text+0xe74) : référence indéfinie vers « cvRound »
./bin/app.o : Dans la fonction « cvEllipseBox » :
app.c:(.text+0x10dc) : référence indéfinie vers « cvRound »
app.c:(.text+0x10fe) : référence indéfinie vers « cvRound »
collect2: error: ld a retourné le statut de sortie 1
make: *** [Makefile:38: bin/app] Error 1

So, I wanted to know, what can I do in order to use OpenCV AND GTK+ (As I don't need OpenCV UI because I already have mine) ?

I also tried to remove gcc by g++ (But this does not solve the problem either) and now it compiles, BUT when I try to run my application using :

$ ./app

I got

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

I think I'm giving up on installing OpenCV to make it works with GTK+...

P.S: If you have any advice or library recommandations (C) I take it.



Solution 1:[1]

Take a look at this discussion https://forum.opencv.org/t/building-opencv-with-opengl-build-error/7106/11 . In OpenCV, currently, Gtk-3 and OpenGL cannot be enabled at the same time. However, from How do you do 3D rendering in Gtk+ using OpenGL?, Gtk-3 and OpenGL can be integrated...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pei JIA