Archived

This topic is now archived and is closed to further replies.

Jer_plusplus

".lib files cannot be opened"

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites