Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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'

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
949 views
Welcome To Ask or Share your Answers For Others

1 Answer

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 Filessofware sdkliblibrary.lib

To:

"C:Program Filessofware sdkliblibrary.lib"

where I added the quotes.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...