0

This is a first time question --- My need for an answer is urgent so I post this as a new question as I lack the reputation to comment on the original question:

I have a USB camera within an ant colony recording certain types of movement --- this works well with OpenCV.

My problem is that the camera freezes every few hours.

I found a solution here: https://raspberrypi.stackexchange.com/a/36664/59430

However, I cannot get the C code to assemble correctly. The error is as follows:

pi@ChamberPi:~/ChamberPi $ sudo nano usbreset.c
pi@ChamberPi:~/ChamberPi $ sudo gcc -o usbreset usbreset.c
usbreset.c: In function ‘main’:
usbreset.c:16:25: error: ‘lt’ undeclared (first use in this function)
     if ( 2 > argc || 3 < argc ) {
                         ^
usbreset.c:16:25: note: each undeclared identifier is reported only once for each function it appears in
usbreset.c:16:27: error: expected ‘)’ before ‘;’ token
     if ( 2 > argc || 3 < argc ) {
                           ^
pi@ChamberPi:~/ChamberPi $

I am certain there is a small error somewhere. Having zero experience with C I request help with solving this error.

Doceave
  • 9
  • 1

1 Answers1

4

This is a common copy and paste error

&lt; is an HTML encoded symbol for <

So you have to replace all these HTML encoded symbols with the real ones. Luckily that code only has that one occurance of that. So please replace &lt; with < and recompile.

In know that sometimes seeing all these mess of text showing up can be confusing but next time just take time to read each line by line and I am sure you will be able to figure out the next problem much easier. In this case it clearly says lt is undefined variable, which it is.. and its not supposed to be there.

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105