meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

courses:ct30a5002:headerinclude [2013/09/19 14:45]
julaakko created
courses:ct30a5002:headerinclude [2013/09/23 18:50] (current)
julaakko
Line 1: Line 1:
 +===== Find out which header to include =====
  
 +If you have problems finding out which header has defined certain variable, use: <code bash>​find /​usr/​include/​ -type f|xargs grep -s -e "​PARAMETER_TO_SEARCH"</​code>​OR without pipe<​code bash>​find /​usr/​include/​ -type f -exec grep -s -e "​PARAMETER_TO_SEARCH"​ {} +</​code>​
 +Exclude the ''/​usr/​include/''​ from the include line and use the rest as include. E.g. if searching for ''​IPV6_MULTICAST'':​ <code bash> ​
 +find  /​usr/​include/​ -type f|xargs grep -s -e "​IPV6_MULTICAST"​
 +/​usr/​include/​i386-linux-gnu/​bits/​in.h:#​define IPV6_MULTICAST_IF 17
 +/​usr/​include/​i386-linux-gnu/​bits/​in.h:#​define IPV6_MULTICAST_HOPS 18
 +/​usr/​include/​i386-linux-gnu/​bits/​in.h:#​define IPV6_MULTICAST_LOOP 19
 +/​usr/​include/​linux/​in6.h:#​define IPV6_MULTICAST_IF 17
 +/​usr/​include/​linux/​in6.h:#​define IPV6_MULTICAST_HOPS 18
 +/​usr/​include/​linux/​in6.h:#​define IPV6_MULTICAST_LOOP 19
 +</​code>​
 +
 +Use the ''​in6.h''​ in ''/​usr/​include/​linux'':​ <code c>#​include <​linux/​in6.h></​code>​
 +
 +----
 +[[courses:​ct30a5002:​start#​code_snippets|CT30A5002 - Games and Networking]]