Trying to make a static lib i got the following error:
Compiling...
example.eba
No Errors
Linking...
Emergence Linker v1.12 Copyright ÂÃ,© 2009 Ionic Wind Software
Unresolved external __imp_sum
Error: Unresolved extern __imp_sum
Error(s) in linking C:\Documents and Settings\.........example.exe
That's the simply code for my static lib:
GLOBAL sum
SUB sum(a:int,b:int),INT
	RETURN a+b
ENDSUB
here is the code where i use it
$USE "sum.lib"
DECLARE IMPORT, sum(a:INT,b:INT),INT
PRINT Sum(12,42)
DO:UNTIL INKEY$<>""
end
Where is the mistake(s) ??  ???
			
			
			
				try this and see if it works:
export sum
global SUB sum(a:int,b:int),INT
	RETURN a+b
ENDSUB
Larry
			
			
			
				King64, use EXTERN instead IMPORT, the import keyword is used only with import libraries, or in special cases as a dynamic function pointer.DECLARE EXTERN, sum(a:INT,b:INT),INT
If you really want to use the import keyword, change your code to
GLOBAL sum
GLOBAL __imp_sum
SUB sum(a:int,b:int),INT
	RETURN a+b
ENDSUB
_asm
align 4
__imp_sum: dd sum
_endasm
Larry, "export" is used only when generating an exe or dll. It does nothing when the target is a static lbrary.
			
			
			
				Thanks Sapero, your explanations are excellent as usual  :)
			
			
			
				you're right as always Sapero.
I had glanced at what I thought was one of my static libs but after going back I see it was for a dll.
Larry