I've created a new C++ project in Visual Studio 2008. No code has been written yet; Only project settings have been changed.
When I compile the project, I receive the following fatal error:
fatal error LNK1104: cannot open file 'C:\Program.obj'
To fix this issue, stop the program and unload it from the debugger before building it again. If the app is open in another program, such as a resource editor, close it. If your program is unresponsive, you may need to use Task Manager to end the process. You might also need to close and restart Visual Studio.
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.
This particular issue is 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 adding the quotes. For example, changing this property from:
C:\Program Files\sofware sdk\lib\library.lib
To:
"C:\Program Files\sofware sdk\lib\library.lib"
where I added the quotes.
This can happen if the file is still running as well.
:-1: error: LNK1104: cannot open file 'debug\****.exe'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With