News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Linker problems

Started by MikeB, March 14, 2008, 05:44:45 PM

Previous topic - Next topic

MikeB

When I try to link my test.obj, I get the error message:
Quote
LINK: warning L4017: /SUBSYTEM : unrecognized option name; option ignored
LINK: warning L4017: /OPT : unrecognized option name; option ignored.
This is when trying to assemble and link using MASM32. Now I opened the command window and typed
link /? and there is no SUBSYSTEM option listed..

Any ideas on why this would occure. I am just no trying to learn assembly and this is my first "test" application.


.386
.model flat, stdcall
option casemap :none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib

.data
HelloWorld db "Hello World!", 0
.code
start:
invoke StdOut, addr HelloWorld
invoke ExitProcess, 0
end start


Any suggestions?

Mike B

ToutEnMasm

Hello,
a "s" is missing
Quote
/SUBSYSTEM:{NATIVE|WINDOWS|CONSOLE|WINDOWSCE|POSIX}[,#[.##]]
here
/SUBSYSTEM:CONSOLE

ic2

This one will comply.. It didn't work and I saw nothing wrong with it.  This use to happen to me when I first got started.  So I got hip and changes everything you see here marked... it's usually happen with start and  end start because of a typo that you can't see...  It was wild for a minute.

      .386;;;;;;;;;
      .model flat, stdcall;;;;;;;;;;;
      option casemap :none   ; case sensitive;;;;;;;;;;;


include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib

.data
   HelloWorld db "Hello World!", 0

    .code;;;;;;;;;;;

start:;;;;;;;
   invoke StdOut, addr HelloWorld
   invoke ExitProcess, 0
end start;;;;;;;;;;

Vortex

There should be no problem with the following :

\masm32\bin\ml /c /coff Test.asm
\masm32\bin\link /SUBSYSTEM:CONSOLE Test.obj

ic2

Vortex , it's funny that it gave me error too than with those changes it assembled but did nothing as I expected.  That's because I don't play with StdOut cause it need more i guest.

Vortex

ic2,

I used Mikeb's code without any modification to build the executable. ml.exe and link.exe didn't report any error messages :

D:\masm32\work3>\masm32\bin\ml /c /coff Test.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: Test.asm

D:\masm32\work3>\masm32\bin\link /SUBSYSTEM:CONSOLE Test.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

ic2

I guest I must did a poor cut and paste job.  What would you expect from a person who can't even register a Window any more  :lol

MikeB

I don't know, I tried assembling and linking from both the masm editor and the command prompt with no luck. Same errors. Like I said, when I type "link /?" I don't even see SUBSYSTEM in the list as an option.


Mike B

MikeB

OK, I deleted the masm32 directory, redownloaded, and installed. Everything worked fine. One thing, this was from a tutorial on the internet. Shouldn't the line "invoke StdOut, addr HelloWorld" have printed the contents of "HelloWorld" to the screen? It doesn't seem to do anything.

Mike B

ic2

I duplicated all my steps and it did work.  Thanks for the heads-up Vortex.  I been at it for days and couldn't sleep.   I done ran out of jokes so I must be tired.

Don't worry MikeB, Vortex is one the best.

Good night/day

hutch--

Mike,

Just have a look at the build batch files that are used in masm32. Also from the menu in QE you can build either a gui or console exe file batch file. here is what one looks like for a console app.


@echo off

if not exist rsrc.rc goto over1
\masm32\bin\rc /v rsrc.rc
\masm32\bin\cvtres /machine:ix86 rsrc.res
:over1

if exist "test.obj" del "test.obj"
if exist "test.exe" del "test.exe"

\masm32\bin\ml /c /coff "test.asm"
if errorlevel 1 goto errasm

if not exist rsrc.obj goto nores

\masm32\bin\Link /SUBSYSTEM:CONSOLE "test.obj" rsrc.res
if errorlevel 1 goto errlink

dir "test.*"
goto TheEnd

:nores
\masm32\bin\Link /SUBSYSTEM:CONSOLE "test.obj"
if errorlevel 1 goto errlink
dir "test.*"
goto TheEnd

:errlink
echo _
echo Link error
goto TheEnd

:errasm
echo _
echo Assembly Error
goto TheEnd

:TheEnd

pause
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php