".lib files cannot be opened"

Started by
3 comments, last by Jer_plusplus 21 years, 11 months ago
Hello. I am using MS VC++ compiler and am getting really frustraded with the program''s errrors on my include files. On my main .cpp, I have #include <d3d8.h> #include <d3d8x.h> Now the .cpp compiles fine with no problem. But when i start to link it (with the .lib files), I''m getting errors of files d3d8.lib and d3d8x.lib. LINK : fatal error LNK1104: cannot open file "..\mssdk\lib\d3d8.lib" I did everything from changing the link directories to copying and pasting the .lib file to my working directory. Still the compiler gives me errors of file cannot be opened! Please help me. Thanks
Advertisement
Search through all your source and header files as well as project settings, and replace "..\mssdk\lib\d3d8.lib" with "d3d8.lib". This should help.
---visit #directxdev on afternet <- not just for directx, despite the name
From the main menu select "Tools" then "Options". From the resulting popup dialog select the "Directories" tab. Look for the pulldown labled "Show Directories for". Examine the paths listed for each category of the pulldown: Executable files,Include files,Library files,Source files. Make certain the paths listed for each category are correct. Add needed paths, remove unneeded paths.

Hope that helps.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
The question is whether you added the libraries in the right way. Did you add them as files to the project? (This is how it should be done, as far as I know, just as you add source files - you should not include them as headers, and it will not work if you try.)
Thanks a lot! All I had to do was add the directory C:\mssdk\include and C:\mssdk\lib to directory Option. Thanks for all your help. It works fine now.

This topic is closed to new replies.

Advertisement