Problem with linking simple program.
From: AsYoDe (spamtrap_at_crayne.org)
Date: 09/28/04
- Next message: Allan Adler : "reading ROM BIOS"
- Previous message: Jim Leonard: "Re: Can't get full drive transfer rate -- what am I doing wrong?"
- Next in thread: David Lindauer : "Re: Problem with linking simple program."
- Reply: David Lindauer : "Re: Problem with linking simple program."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 28 Sep 2004 18:38:45 +0000 (UTC)
Hi!
I have a problem linking simple program.
The code was longer and contained also console I/O functions but I cut
them out to show the part that produced error.
Compiling this under NASM [nasmw.exe -fwin32 $(FileName)] completes
succesfully but linking under ALINK [ALINK.exe -oPE $(FileNameNoExt)
-subsys console win32.lib WinInet.lib -entry main] produces error:
---------- to .exe (ALINK) ----------
ALINK v1.6 (C) Copyright 1998-9 Anthony A.J. Williams.
All Rights Reserved
Loading file zxc.obj
Loading file win32.lib
Loading file WinInet.lib
483 symbols
Loaded first linker member
matched Externs
matched ComDefs
Unresolved external InternetOpen
Unresolved external InternetOpenUrl
Output completed (0 sec consumed) - Normal Termination
--- Seems that linker couldn't find those functions in WinInet.lib and I dont know why. F.e. WriteFile [from win32.lib] is linked without problems. --code [NASM syntax]-- [extern GetStdHandle] [extern ExitProcess] [extern WriteFile] [extern InternetOpen] [extern InternetOpenUrl] [segment .text] [global main] main: push 10000000h ;INTERNET_FLAG_ASYNC push 0 ;lpszProxyBypass push 0 ;lpszProxyName push 1 ;INTERNET_OPEN_TYPE_DIRECT push agent call InternetOpen mov [InternetOpenHandle], eax push 0 ;dwContext push 0 ;dwFlags push 0 ;whateva dwHeadersLength push 0 ;lpszHeaders push url push InternetOpenHandle call InternetOpenUrl mov [InternetOpenUrlHandle], eax call Exit ret Exit: push dword 0 call ExitProcess ret [segment .data] agent db 'GoFTP', 0 InternetOpenHandle dw 0 url db 'http://www.programowanie.host.sk/grafika/pgp.txt', 0 InternetOpenUrlHandle dw 0 -- pozdrawiam AsYoDe mail: [nick]@o2.pl
- Next message: Allan Adler : "reading ROM BIOS"
- Previous message: Jim Leonard: "Re: Can't get full drive transfer rate -- what am I doing wrong?"
- Next in thread: David Lindauer : "Re: Problem with linking simple program."
- Reply: David Lindauer : "Re: Problem with linking simple program."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]