command line - GCC and NASM link to external library -


i want create simple application in assembly (with nasm) command line arguments. use extern _getcommandlinea , call _getcommandlinea call function. compile code , object file nasm. wanna use gcc link , create exe. don't want use standard libraries, use command build executable:

gcc test.obj -s -nostartfiles -nostdlib -nodefaultlibs -o test.exe 

it gets me undefined reference getcommandlinea error and, beginner in asm, don't know why? appreciated. in advance!

getcommandlinea , getcommandlinew defined in kernel32.dll which, of windows api, uses winapi (stdcall) calling convention.

in order call function assembly, need specify "decorated" symbol name, in case _getcommandlinea@0

replace _getcommandlinea in assembly file _getcommandlinea@0


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -