Now, I doing study about make & using Dynamic Link Library.
This is my Trainning Code that refered Icezelion DLL Tutors.
############################################################
Comment^........................................................
File: MycroDll.asm
Note: Source Code of MycroDll.DLL
Date: AH. 63.09.03
^.....................................................................
.386
.MODEL FLAT, STDCALL
OPTION CASEMAP:NONE
INCLUDE \MASM32\Include\Windows.inc
;; this line causes Link warning error ..!!
INCLUDE \MASM32\Mymacro\Mymacros.inc
INCLUDE \MASM32\Include\user32.inc
INCLUDE \MASM32\Include\kernel32.inc
INCLUDELIB \MASM32\Lib\user32.lib
INCLUDELIB \MASM32\Lib\kernel32.lib
.DATA
;
.CODE
DllEntry PROC hInstDLL:HINSTANCE, reason:DWORD, reserved1:DWORD
MOV EAX, TRUE
RET
DllEntry ENDP
Who_are_you? PROC
;; these are macro sentences of Mymacros.inc
Display_string literal("I am Mac.")
Return
Who_are_you? ENDP
END DllEntry
############################################################
........................................................
File: MycroDll.def
Note: Procedure definitions of MycroDll.DLL
Date: AH. 63.09.03
........................................................
LIBRARY MycroDll
EXPORTS Who_are_you?
############################################################
........................................................
File: MycroDll.bat
Note: Auto make batch for MycroDll.DLL
Date: AH. 63.09.03
........................................................
@echo off
if exist MycroDll.OBJ del MycroDll.OBJ
if exist MycroDll.DLL del MycroDll.DLL
\MASM32\bin\ML /c /coff MycroDll.ASM
\MASM32\bin\LINK /DLL /SUBSYSTEM:WINDOWS /DEF:MycroDll.DEF MycroDll.OBJ
Dir MycroDll.*
pause
############################################################
Assemble & Link process is normally OK when removed this line in MycroDll.asm.
INCLUDE \MASM32\Mymacro\Mymacros.inc
If insert this line, it occures Link error as following 'Warning' Message.
Creating library MycroDll.lib and object MycroDll.exp
LINK : warning LNK4089: all reference to "user32.dll" discarded by /OPT:REF
Please teach me, why & what meaning it ?
It's a nice hint from the linker that you can probably remove the "includelib ...\user32.lib" line in your source without damage, thus saving some bytes on your storage medium. Besides that, you won't gain or loose much.
if remove the "includelib ...\user32.lib" line, it causes this problem.
Creating library MycroDll.lib and object MycroDll.exp
MycroDll.obj : error LNK2001 : unresolved external symbol _wsprintfA
MycroDll.dll : fatal error LNK1120: 1 unresolved externals
Thank you, Japheth
I solved my problem by using small subset of Mymacros.inc.
Perhaps it has problems in Mymacros.inc.
But i don't understand any macro causes problems, yet.