Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: No Previous Declaration - C++ [closed]

Tags:

c++

I am stumped about the cause of this:

recorders/r5000device.cpp: In function ‘unsigned int r5000_device_tspacket_handler(unsigned char*, int, void*)’:
recorders/r5000device.cpp:34:14: warning: no previous declaration for ‘unsigned int r5000_device_tspacket_handler(unsigned char*, int, void*)’ [-Wmissing-declarations]
 unsigned int r5000_device_tspacket_handler(unsigned char *tspacket, int len, void *callback_data)
          ^
recorders/r5000device.cpp: In function ‘void r5000_msg(char*)’:
recorders/r5000device.cpp:44:6: warning: no previous declaration for ‘void r5000_msg(char*)’ [-Wmissing-declarations]
 void r5000_msg(char * msg)
  ^
like image 550
user3033518 Avatar asked Nov 26 '13 22:11

user3033518


1 Answers

You have the compile flag -Wmissing-declarations set. The compiler wants to see declarations (prototypes - usually in headers) for all function. Just add the missing headers or declare the prototype at the top of the file.

like image 143
egur Avatar answered Sep 23 '22 10:09

egur