Defining new variables for use in multiple c files. How do I create header files that can be #included in multiple c files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to define a variable that needs to be manipulated by one c
file in the kernel and read by another c file in a different directory. 
I have defined the variable in a header file that is #included in both c
files.  The problem is when I compile the kernel I get an error saying
that the variable cannot be defined more than once.  I added a
preprocessor condition like this:

#ifndef _NEW_HEADER_H
#define _NEW_HEADER_H

//define the variable

#endif

it was my assumption that the variable would only be defined once
because of this macro but I am still having the same problems.

How do I create header files that can be #included in multiple c files
like the files in the source tree?

thanks for you patience,

-brahan

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux