patacongo opened a new issue #1158:
URL: https://github.com/apache/incubator-nuttx/issues/1158


   This error occurs because:
   
   1. `g_video_devops` is declared in `video.h` with no `extern`.  So every 
inclusion of `video.h` creates a new instance of `g_video_devops`.  Hence, the 
"multiple definition" error at link time.
   
       video/video.h:FAR const struct video_devops_s *g_video_devops;
   
   2. There is no other declaration of` g_video_devops` (at least as far as I 
can find).  If you correct the problem by adding the `extern` to the 
declaration in `video.h`, then I think you still get a link time error because 
`g_video_devops` would be undefined.
   
   Use of global variables in **_extremely_** bad style in an RTOS.  The 
correct fix is to remove `g_video_devops` altogether and pass the instance as a 
parameter as is done fore every other driver.  Related Issue:  #439


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to