Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/09/05 10:10
Read: times


 
#89328 - think more
Responding to: ???'s previous message
hi,

Manisha Prabhu said:
I tried using

public lup;

the assembler gives error


Indeed, because syntax error. Please read how to use PUBLIC and EXTRN directives. It is not hard. And if you used PUBLIC lup in one file (which it is created in) then think logicaly: where do you need to use EXTRN? In short: PUBLIC is used to mark any node (variable, function, simple number etc) in the file to be visible from other files. This way allows you to use the same names/labels in many files as long as they are not defined as PUBLIC. This directive may be useful for optimizer as well.
EXTRN is used by compiler to recognize the type of an external node, so compiler may do its work even without actual node definition in the compiled file. But the linker/locator really needs with both directives. Is it still not clean?

Regards,
Oleg

List of 14 messages in thread
TopicAuthorDate
How to link more than 2 files            01/01/70 00:00      
   Hint            01/01/70 00:00      
      More hints            01/01/70 00:00      
         Link more than two files            01/01/70 00:00      
            PUBLIC and EXTERNAL            01/01/70 00:00      
               correction: PUBLIC and EXTRN            01/01/70 00:00      
               linkining more than one file            01/01/70 00:00      
                  think more            01/01/70 00:00      
                     linking more than one file            01/01/70 00:00      
                        use pair PUBLIC/EXTRN            01/01/70 00:00      
                           Program Linkage            01/01/70 00:00      
   INCLUDE            01/01/70 00:00      
      no include            01/01/70 00:00      
         about include            01/01/70 00:00      

Back to Subject List