News:

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

LINK : fatal error LNK1181 Error

Started by uncleroxk, May 19, 2009, 11:11:40 AM

Previous topic - Next topic

uncleroxk

Hi, i am new to the assembly language, and i am trying to follow the tutorial here: http://devpinoy.org/blogs/cvega/archive/2009/01/24/setting-up-your-masm32-development-environment.aspx

When i open the test.asm in the quick editor and press Project/build all, i got this error.

LINK : fatal error LNK1181: cannot open input file "C:\project/test.obj"

_
Link error


Can you guys tell me whats wrong with my installation?
Thanks

uncleroxk

I have notice that the test.obj is created in the C:\masm32 instead... how do i change it?

Vortex

Assuming that your project files are located in C:\project, try this batch file.

Build.bat :

\masm32\bin\rc Rsrc.rc
\masm32\bin\ml /c /coff DlgBox.asm
\masm32\bin\polink /SUBSYSTEM:WINDOWS DlgBox.obj Rsrc.res


I also assume that your folder named project and the Masm32 installation are residing on the same partition C,D,E or whatever letter.



[attachment deleted by admin]

UtillMasm

yes, i never use QEditor too. (why don't use it, because it has be packed, and i don't have source. so now, only way: don't use it.)

my solution:
    open Command Prompt
    and type...
         cd /d c:\
         md UtillMasm
         copy con test.asm(press Enter)
         ...
         (press Ctrl+Z then Enter)
         copy con test.cmd(press Enter)
         ...
         (press Ctrl+Z then Enter)
    press Win+R then select 'c:\UtillMasm\test.cmd' then Enter
    first EXE be done.

###

test.asm:
    .386
    .model flat,stdcall
    .code
    start:ret
    end start
test.cmd:
    @c:\masm32\bin\ml.exe /c /coff /Fotest.obj /nologo test.asm
    @c:\masm32\bin\link.exe /subsystem:windows /out:test.exe /nologo test.obj
    @pause

dedndave

i think UtillMasm is crazy --->  :dazzled:
you can open Windows Explorer
navigate to the folder where you want to create the file(s)
right-click in the right hand pane - New - Text Document
create the file as .txt and rename it to .asm, .bat. or .cmd


jj2007

Try finding out where the slash was introduced:

C:\project/test.obj

Vortex

Hi dedndave,

Quotecreate the file as .txt and rename it to .asm, .bat. or .cmd

If you rename the file in Windows Explorer, the file will have double extension like this one :

test1.asm.txt

I guess you are renaming the file in the command prompt.

uncleroxk

Hi all, thanks for all your help, i have create a batch file like what Vortex have did, and it works fine now!  :cheekygreen:

UtillMasm


dedndave

Vortex
nahhhhhhhhhhhhh - lol
i do it every day
you must have the "Hide extensions for known file types" turned on
Windoze Explorer - Tools menu - Folder Options - View tab - uncheck the box "Hide extensions for known file types"
i'd go nuts if i couldn't see the extensions (maybe that's what happened to Utill) - lol - one of the first things i change on a fresh rebuild
of course, when you rename a file and change it's extension, you get a warning message - click yes or hit enter to skip past it
i'd like to figure out which button i mash to get rid of that warning - lol

UtillMasm

what happen to UtillMasm:
            my mouse stopped working for long time, fxxxx :'(

dedndave

batteries ?
what is your name Utill (what your friends call you)

Vortex

Quote from: dedndave on May 19, 2009, 12:29:56 PM
Vortex
nahhhhhhhhhhhhh - lol
i do it every day
you must have the "Hide extensions for known file types" turned on
Windoze Explorer - Tools menu - Folder Options - View tab - uncheck the box "Hide extensions for known file types"

True. Generally, that switch is turned on. This is the default setting.  I prefer using the command prompt to rename files as it allows to process multiple files.

dedndave

i also turn off the "hide system files" and turn on the "show hidden files"
that doesn't mean i mess with em - lol
but - i want to know what's there - i often check the date/time stamps to see if something is messing with them
i hate it when the OS hides stuff from me
i suppose, for joe sixpack, it's a good idea

dedndave

#14
You guys got me thinking - there is a way to add a file type to the "New" context menu
I wrote this one for .asm files, but the method is similar for .bat or .cmd files, as well
(the attached ZIP has the instructions, pictures, and the .reg file)


1) Create a file association for ASM files

   a) Open Windows Explorer
   b) Tools menu - Folder Options - File Types tab
   c) Check the list to see if the file association already exists (some IDE's may create it)
      If the file association already exists, you may skip to Step (2)
   d) New (Registered file type) button
   e) Enter the extension "ASM" (without the quotes)
   f) Click OK button - the file type now appears in the list
   g) Click on the ASM file type in the list to select it (highlight)
   h) Near the bottom - Details for 'ASM' extension - click the Advanced button
   i) Enter the name for the file type "Assembler File"
   j) Click on the Change Icon Button to select the "text file" icon
   k) Under "Actions", click the New button (to create a new action)
   l) In the Action window, type "Open"
   m) In the Application window, type "C:\Windows\system32\Notepad.exe %1
   n) Check the "Use DDE box
   o) In the DDE Application window, type NOTEPAD
   p) In the DDE Topic window, type "System"
   q) Click the OK buttons to close all windows

2) Add the file type to the "New" context menu

   a) Create a .reg file with the following text in it:

REGEDIT4

[HKEY_CLASSES_ROOT\.asm\ShellNew]
"NullFile"=""

   b) Click (or double-click) on the .reg file to import the file into the registry

3) Re-boot


EDIT:
For .asm files, you may also like to create a default template that has your favorite basic stuff in it
Create the .asm file template to suit your tastes
Name the file "AssemblerFile.asm"
Place it in the "C:\Documents and Settings\All Users\Templates" folder
Once the file is in the Templates folder, you may update it any time you like
Import the following .reg file.....


REGEDIT4

[HKEY_CLASSES_ROOT\.asm\ShellNew]
"FileName"="AssemblerFile.asm"


[attachment deleted by admin]