The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Robert Collins on February 28, 2005, 11:32:52 PM

Title: Extern's really blowing my mind
Post by: Robert Collins on February 28, 2005, 11:32:52 PM
I am writting a program using two modules. In Module A I use some functions that are defined in Module B. So, in Module A I declare all of those functions as 'extern' and I not only define the functions in Module B but I also include the proto for them as well. During the compile stage there is no problem but during link time I get unresolved external references on all of the functions. What else can/should I do? I don't get it :dazzled: 
Title: Re: Extern's really blowing my mind
Post by: Robert Collins on February 28, 2005, 11:59:44 PM
OK, never mind. I think I found the reason. The functions in Module B are declared as static and I guess that you can't define static functions as extern in Module A so I had to copy the functions using those static functions from Module A to Module B.
Title: Re: Extern's really blowing my mind
Post by: rea on March 01, 2005, 04:43:23 AM
You are using "C" or for what you say that your functions are declared as static?? (I dont get it)


Also watch the documentation of your assembler.


For example like I know extern is "Importing Symbols from Other Modules" mean that in the object file the assembler will put a flag in the name of the function or somewhere, indicating that the symbol is not defined in the actual object file and is needed to know where the symbol is.

And global or public is "Exporting Symbols to Other Modules" mean that in the object file the assembler will put a flag in the name of the function or somewhere, indicating that the symbol is defined in the current object file and that others modules that have a reference to the name can "know" where is the entry point.



By the way, a symbol  indicate a place in memory.