The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Samishii23 on September 09, 2010, 02:25:19 PM

Title: Having issues assembling in MASM
Post by: Samishii23 on September 09, 2010, 02:25:19 PM
Hello, I'm fresh off the internet bus.
I've been reading up on Iczelion (http://win32assembly.online.fr/tutorials.html)'s Asm tutorials, and I have downloaded and installed MASM32, but for some reason even the pre-written files won't Link to be made to exe format...

I'm refering to the copy and paste of the generic window code, and really all code...
When I go to the menu: Project ->Assemble & Link option... I get:
Assembling: C:\...\...\WIN.asm
(Microsoft Copyrights)
LINK : fatal error LNK1181: cannot open input file "C:\...\...\WIN.obj"
Link error


Link to the code: http://win32assembly.online.fr/tut3.html... Plus theres a zip with the asm file, a make file, exe, and obj file. I removed the exe file. But when I try the Assemble & Link option, it deletes the .obj file then errors.

What could I be doing wrong?
Title: Re: Having issues assembling in MASM
Post by: clive on September 09, 2010, 03:39:05 PM
Perhaps you want ".." as "..." is not valid.
Title: Re: Having issues assembling in MASM
Post by: Tedd on September 09, 2010, 03:49:57 PM
Presumably the '...' is his own ellipsis to avoid writing out the full path.


The problem is more likely to be the masm installation than the code itself.
The most common problem is that there's a space in the path, which gets split off when the parameters are passed to the batch file.

Try this, and report back what you get (complete with full pathnames, error messages, etc):
- unzip tut3.zip into a folder
- delete all files except the .asm
- Project -> Assemble
- if that worked, Project -> Link
Title: Re: Having issues assembling in MASM
Post by: Samishii23 on September 09, 2010, 04:15:44 PM
Thanks for the fast replys.

I run Windows XP, and had all the files either on my desktop or My Docs folder.
Since you said something about the spaces in the file name. I've moved the files.

Assembled "WIN.asm":
Assembling: D:\~Projects~\ASM\WIN.asm
Volume in drive D has no label.
Volume Serial Number is 407C-AA0B

Directory of D:\~Projects~\ASM

Update:
I have since moved all the files into C:\ drive with no spaces, and the problem still occurs.
07/10/2001  07:52 AM             1,987 WIN.ASM
               1 File(s)          1,987 bytes
               0 Dir(s)  74,512,506,880 bytes free


Link obj file:
(Microsoft Copyright)

LINK : fatal error LNK1181: cannot open input file "D:\~Projects~\ASM\WIN.obj"
( drive information 74gb free )


Update:
I have since moved all the asm files to C:\ drive and theres no spaces in the file path. Still no change.
Title: Re: Having issues assembling in MASM
Post by: Samishii23 on September 09, 2010, 04:38:47 PM
Slight update...
In the MASM menu, I used Code ->Create New GUI Application... After it made all the files and what not, it assembled fine. Exe works fine.

When I open up the same project in MASM32 it still gives the same above error when trying to link the obj file. :'(
But when compiled from a batch file that was generated from the Wizard, it'll compile fine.  :'(
Title: Re: Having issues assembling in MASM
Post by: Tedd on September 10, 2010, 01:06:16 PM
Strange.

Completely remove the masm32 package and install fresh.
Then try building a plain asm file from a folder with a simple name (no spaces, no symbols, just alphabetic characters) on the base of the same drive masm32 installed to.
Title: Re: Having issues assembling in MASM
Post by: Samishii23 on September 10, 2010, 10:02:54 PM
Install: C:\masm32\
File: C:\Projects\WIN.asm
Screenshot: Project -> Assemble ASM File & Project -> Link OBJ File

Error: LNK1181: Cannot open input file "C:\Projects\WIN.obj"  :'(

Files in ZIP:
- WIN.asm
- ScreenShot of Assemble and Link windows
Title: Re: Having issues assembling in MASM
Post by: clive on September 10, 2010, 10:35:39 PM
It does not appear to be completing the ML (MASM) portion, and consequently it does not generate an .OBJ for the Linker to work with. Try actually running MASM from the command line.
Title: Re: Having issues assembling in MASM
Post by: Samishii23 on September 10, 2010, 11:20:57 PM
Uh... Where would I go to learn how to do that?
Title: Re: Having issues assembling in MASM
Post by: hutch-- on September 11, 2010, 12:09:24 AM
A number of things.

1. Ensure your OS/AV software is not interfering with the installation and that the installation completes correctly.
2. Verify that the install is working correctly by building some of its examples from the default editor.
3. Ensure that any code you are trying to build uses VALID PATHS for the assembler, linker and resource compiler.

If you are still having problems show us a small sample of the code you are trying to build.
Title: Re: Having issues assembling in MASM
Post by: Samishii23 on September 11, 2010, 02:35:50 AM
Alrighty then... Um, I'm not sure if this is how most programmers do this...  :boohoo:
But as I am new, I'll just therefore declare my n00bness, and say what i'm doing now...
Ok I think I found what I was doing wrong. Stuff is compiling now...

At first I did the Create EXE makeit.bat and that did the batch file which compiled it fine. ( which what I was about to post about )
Then I looked under the Project menu again, and after seeing the batch console make... I tried the menu option Console Assemble & Link... Which then proceeded to make the exe fine... ( after running  the program to check to see if it worked, I had to shut up SUPERAntiSpyware from stoping the exe... )

Sorry about all the hassle guys, and thanks for trying to help me!
Hopefully my next set of posts will be regarding actually programming! :8)