News:

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

Occasional LNK1104 error MASM in VS2008

Started by Quinn1000, October 18, 2010, 08:16:58 PM

Previous topic - Next topic

Quinn1000

Hi, I'm new so if this is the wrong place please let me know.

I am taking an Assembly class and often when I go to build one of my programs on my home PC (running Server 2008) I get an 'LNK1104 cannot open file myproj.exe' error for a couple of minutes.  If I wait a few minutes and try it again, the linking goes OK.  I have tried to figure out some rhyme or reason to the problem, but there doesn't seem to be any.  It is as if the file gets locked for a few mminutes, then unlocked.  I've searched the forum (and elsewhere) and found reference to LNK1104 errors, but those seemed to involve libraries and so on.

jj2007

It may be an access rights problem. One cause might be that assembler produces small executables that make some antivirus software choke. Try suspending the AV, or exempting the folder where you create the exe from scanning.

redskull

Also, check the task manager to make sure your program exits correctly.  If you have some sort of error that makes your process stay running for some time after the window is gone, link will be unable to overwrite the file.

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

clive

Quote from: redskull
Also, check the task manager to make sure your program exits correctly.  If you have some sort of error that makes your process stay running for some time after the window is gone, link will be unable to overwrite the file.

Or if you still have it running/open because you didn't exit/close it, done that a bunch of times.

Other fun will occur if the file is on a different server, and the times are out-of-sync, but that's more of a MAKE issue, than a LINK one.
It could be a random act of randomness. Those happen a lot as well.

Antariy

Quote from: Quinn1000 on October 18, 2010, 08:16:58 PM
I get an 'LNK1104 cannot open file myproj.exe' error for a couple of minutes.  If I wait a few minutes and try it again, the linking goes OK.  I have tried to figure out some rhyme or reason to the problem, but there doesn't seem to be any.  It is as if the file gets locked for a few mminutes, then unlocked.  I've searched the forum (and elsewhere) and found reference to LNK1104 errors, but those seemed to involve libraries and so on.

Check for running of "mspdbsrv.exe" process. If it is runned, terminate it, and try to link immediately after termination of "mspdbsrv.exe". Probably this is not reason, but try this.



Alex

Quinn1000

#5
Similar to what jj2007 said, I created a new location for my asm projects outside of the default VS Project location (which is in the Libraries/Documents folder).  So far so good but my program hasn't thrown an exception yet.

Update:  Moving the project out of the default location seems to be working!  Thanks for the help!

Update:  Still happening after all.  Killed mspdbsrv.exe but that did not help.  I do have a bunch of conhost.exe's that hang around, but killing them doesn't seem to help. 

I am changing 'invoke  exitProcess,0' to just 'exit' and maybe that will help with the Console Host processes hanging around. but I have always been seeing the program 'has exited with code 0 (or occasionally some other code if I have made a mistake) regardless.


GregL

Quinn1000,

The exit macro just calls ExitProcess, that won't make any difference.

Quote from: \masm32\macros\macros.asm
exit MACRO optional_return_value
      IFNDEF optional_return_value
        invoke ExitProcess, 0
      ELSE
        invoke ExitProcess,optional_return_value
      ENDIF
ENDM

Quinn1000

Right.  It doesn't :(  But ty for the information   :bg

Quinn1000

#8
Well I hate to admit this, but I thought I had VS set to run as administrator but did not.  Guess it makes a difference even when you are logged on as admin.

This forum is not a paid help desk, please don't treat it like one. Spare us the "problem Solved" type labels.