Share via


Visual Studio Error LNK1104 Can not open file

Question

Wednesday, June 21, 2017 7:06 AM | 1 vote

Hello,

I am currently taking a class in Assembly Language for the x86 processor family. I am not very familiar with the language or visual studio at this point. However my professor has provided the basic setup of each assignment with the code for the main.asm file atleast partially written. In Visual studio the main.asm file will successfully compile but when I try to build the solution or start without debugging I always get a LNK1104 error that Visual Studio can not open the file. This happens even if I do not modify the file and attempt to build it without any changes from the instructor. I have read through the support documentation extensively and most of these errors seem to be attributed to an incorrect SDK version in previous versions of Visual Studio. However I have the latest version and am currently suing the SDK version 10.0.15063.0. Any guidance would be greatly appreciated. I can supply any additional info needed as well. Thank you.

Ryan

All replies (3)

Thursday, June 22, 2017 9:15 AM

Hi Ryan,

Welcome to MSDN forum.

Which version of visual studio are you using?

>> In Visual studio the main.asm file will successfully compile but when I try to build the solution or start without debugging I always get a LNK1104 error that Visual Studio can not open the file.

If it's okay please share more operation details.

Please refer to WayneAKing’s answer describe the steps using VC++ 2008 Express to build one of the examples from referenced site from this thread.

https://social.msdn.microsoft.com/Forums/en-US/9d8daaef-5df1-4dee-8a58-1ca567d53966/help-needed-fatal-error-lnk1104-cannot-open-file-debugobj?forum=Vsexpressvc

Hope it helps

Best regards,

Fletcher

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Saturday, June 24, 2017 9:04 PM

I am using Visual Studio 2017 but I have also tried 2013 just to see if it was something specific to 2017 and it happens in both versions. I will try to follow the example from the thread you linked and report back.


Monday, June 26, 2017 1:56 AM

Dear friend,

The issue could also be caused by specifying a dependency to a lib file that had spaces in its path. The path needs to be surrounded by quotes for the project to compile correctly.

On the Configuration Properties -> Linker -> Input tab of the project’s properties, there is an Additional Dependencies property. This issue was fixed by changing this property from:

C:\Program Files\sofware sdk\lib\library.lib

To:

" C:\Program Files\sofware sdk\lib\library.lib"

Where just added the quotes.

And also, here is the thread with the similar issue, several possible resolutions might be helpful:

https://stackoverflow.com/questions/3906404/link-fatal-error-lnk1104-cannot-open-file-d-myproj-exe

Looking forward to your feedback

Best regards,

Fletcher

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].