Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error LNK1104

Tags:

visual-c++

When I compile my code in visual studio c++ 2008 I get the following error:

fatal error LNK1104: cannot open file 'C:\Users\...\Documents\Visual Studio         
2008\Projects\...\Debug\....exe

I just copied my code from another project in visual studio C++ and pasted it in this project again in VS C++. Can it cause this error?

like image 596
Bahareh Avatar asked Aug 20 '12 01:08

Bahareh


People also ask

How do I fix linker errors?

You can fix the errors by including the source code file that contains the definitions as part of the compilation. Alternatively, you can pass . obj files or . lib files that contain the definitions to the linker.

Where is kernel32 Lib located?

kernel32. lib is THE fundamental Windows API library. It is found in the Windows SDK and the default set of library locations should include it.


3 Answers

This can happen because, for example, the executable is currently executing or opened by another program, or because you don't have the right permissions for that directory.

like image 131
Puppy Avatar answered Sep 22 '22 15:09

Puppy


open TASK MANAGER and see if the process of the .exe is running in background even after closing it. if yes, then kill the process and then try to run it again.

like image 31
ivy Avatar answered Sep 21 '22 15:09

ivy


This can happen if you have turned on preprocessor output, e.g. in Properties | C/C++ | Preprocessor | Preprocess to a File == YES. Creating a preprocessor output file (of file type .i) is mutually exclusive to creating an object file (of time .obj).

like image 20
Henry Avatar answered Sep 20 '22 15:09

Henry