How do I place a library in global scope so all c files can see it?

How do I get a library into the global scope so all C files will be able to use it?
If it is possible, specifically how do I accomplish this?

I’m using 10.72 with the c files added to the project window btw.

I assume you are using Project Explorer and multiple c files. I think you can #include the file in a header file and #include the header file in whichever c file needs it.

The basic rules for structuring Project Explorer projects are as follows:

  1. Eliminate .H files from the Project Explorer window. Instead, #include .H files as needed in the various .C files.

  2. Functions, macros and typedefs (including structure typedefs) which are accessed in multiple .C files should be prototyped / defined / typedef’d in a .H file and the .H file #included by each file that accesses the function / macro / typedef. Generally, the prototype / macro / typedef would be placed in the .H file corresponding to the .C file where the function / macro / typedef is implemented / associated / instantiated.

  3. Declare global variables to be extern in the appropriate .H file. If the global variable is a structure, declare the extern structure variable following the structure definition / typedef. For example, keep “bbram cfgstruct Cfg;” in main.C but put “extern bbram cfgstruct Cfg;” in main.H, following the cfgstruct typedef.

I also suggest reading any ANSI C book which discusses file scoping.

Thank you very much for the answer. I realize now from your answer that I needed to be a little more specific. I think the answer to my question is to #use the DC libraries in each source file that needs them. I tried this and it seems to work except for a few caveats, that I finally worked out. I’m a programmer coming from an ANSI C background trying to figure out DCs way of doing things.