# Help. Compilation Error on 4.5.2

**URL:** <https://forum.opencv.org/t/help-compilation-error-on-4-5-2/2933>\
**Category:** C++\
**Tags:** highgui, build\
**Created:** [April 23, 2021, 7:28am UTC](https://forum.opencv.org/t/help-compilation-error-on-4-5-2/2933 "2021-04-23T07:28:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Outsider](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@Outsider](https://forum.opencv.org/u/Outsider)\
**Post date:** [April 23, 2021, 7:28am UTC](https://forum.opencv.org/t/help-compilation-error-on-4-5-2/2933/1 "2021-04-23T07:28:48Z")

</div>

Hello. My code gives an error when compiling. I’m not sure how to fix this problem. Any help is really appreciated.

/usr/bin/ld: /tmp/cc095JWC.o: Undefined reference to symbol ‘\_ZN2cv7waitKeyEi’  
//usr/local/lib/libopencv\_highgui.so.4.5: error adding symbols: DSO missing from command line

Here’s the screenshot:

 ![2021-04-22_16-54-43-aea099103e95e3d735532e87f4591707](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/9/9ca719eba917d23aa1019b94121d7dd94ab41b75.png)

And here’s the code:

```
#include <opencv2/opencv.hpp>
#include <raspicam_cv.h>
#include <iostream>
#include <chrono>
#include <ctime>
using namespace std;
using namespace cv;
using namespace raspicam;

Mat frame;

 void Setup ( int argc,char **argv, RaspiCam_Cv &Camera )
  {
    Camera.set ( CAP_PROP_FRAME_WIDTH, ( "-w",argc,argv,400 ) );
    Camera.set ( CAP_PROP_FRAME_HEIGHT, ( "-h",argc,argv,240 ) );
    Camera.set ( CAP_PROP_BRIGHTNESS, ( "-br",argc,argv,50 ) );
    Camera.set ( CAP_PROP_CONTRAST ,( "-co",argc,argv,50 ) );
    Camera.set ( CAP_PROP_SATURATION, ( "-sa",argc,argv,50 ) );
    Camera.set ( CAP_PROP_GAIN, ( "-g",argc,argv ,50 ) );
    Camera.set ( CAP_PROP_FPS, ( "-fps",argc,argv,100));

}
int main(int argc,char **argv)
{
        RaspiCam_Cv Camera;
	Setup(argc, argv, Camera);
	cout<<"Connecting to camera"<<endl;
	if (!Camera.open())
	{
	cout<<"Failed to Connect"<<endl;
     }
     cout<<"Camera Id = "<<Camera.getId()<<endl;
    
     while(1)
    {
    auto start = std::chrono::system_clock::now();
    Camera.grab();
    Camera.retrieve( frame);
    auto end = std::chrono::system_clock::now();
    std::chrono::duration<double> elapsed_seconds = end-start;
    float t = elapsed_seconds.count();
    int FPS = 1/t;
    cout<<"FPS = "<<FPS<<endl;
    imshow("orignal", frame);
    waitKey(1);
    }
    return 0;
}
```

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [April 23, 2021, 8:01am UTC](https://forum.opencv.org/t/help-compilation-error-on-4-5-2/2933/2 "2021-04-23T08:01:32Z")

</div>

have a look at the opencv libraries you’re linking. opencv\_highgui missing there ?

---

<div class="post-metadata">

**Author:** ![Outsider](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@Outsider](https://forum.opencv.org/u/Outsider)\
**Post date:** [April 23, 2021, 8:59am UTC](https://forum.opencv.org/t/help-compilation-error-on-4-5-2/2933/3 "2021-04-23T08:59:41Z")

</div>

Thank you, for your answer, berak. Yes, I knew that was something with highgui library file and I tried to link a library such as \<opencv2/highgui.hpp\> but nothing helped. And after that I looked at my opencv configure file and just pointed out that I left one spelling mistake 🙂

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [April 23, 2021, 9:06am UTC](https://forum.opencv.org/t/help-compilation-error-on-4-5-2/2933/4 "2021-04-23T09:06:14Z")

</div>

> [@Outsider](#):
>
> \<opencv2/highgui.hpp\>

that’s a header, (you include it), not a library

but ok, it seems to be solved, now 😉
