@Dibya
Since you're not showing me your code, there's not much I can do. But I wrote a simple but classic example of creating a DLL library and linking to multiple libraries as an example and reference. You can use it to slowly extend the imports and externs one at a time to add more library as a practice and see how it goes. All of these are using GoLink as the main linker.
The library (prog.dll):
;----------------------
;Creating a DLL library with 2 services
;1. to print a null-terminated string
;2. To exit the code gracefully
;-----------------------
;nasm -f win32 prog.asm
;golink /dll prog.obj kernel32.dll msvcrt.dll
;-----------------------
global MyExit
export MyExit
global MyPrint
export MyPrint
extern _ExitProcess@4 ;from kernel32
extern printf ;from msvcrt (C)
section .text
;To print an ASCIIZ string
;Push the address of the string
MyPrint:
push ebp
mov ebp,esp
mov esi,[ebp+8]
push esi
call printf
add esp,4 ;CDECL clean up
mov esp,ebp
pop ebp
ret 4 ;stdcall clean up
;Exit the code
;No arguments
MyExit:
push 0
call _ExitProcess@4
ret
Now an example on how to access the library (prog.dll) AND another library from "user32.dll" just to make it more interesting;
;--------------------------------
;To access services provided by prog.dll (the lib)
;nasm -f win32 test.asm
;golink /console test.obj prog.dll user32.dll
;--------------------------------
global Start
extern MyExit ;import from prog.dll
extern MyPrint ;import from prog.dll
extern _MessageBoxA@16 ;import from user32.dll
section .data
hello db 'Hello World',0ah,0
msg db 'Hello',0
section .text
Start:
push hello
call MyPrint
push 0
push msg
push msg
push 0
call _MessageBoxA@16
call MyExit
Take it slowly and don't miss out any details.
Enjoy.