BSCMAKE: error BK1506 : cannot open file StdAfx.sbr No such file or directory

I have converted one of my VS2006 projects into VS2008 and when trying to build the project in VS2008 I get the above error. What is .sbr file ? and how can I fix the compile error? Any help is hugely appreciated.

Upvotes: 7

Views: 27338

Answers (5)

RJo
RJo

Reputation: 13

I'm new to c++ and I'm using Visual Studio 2008. I was trying to add a new class to a large program and got the same error (BK1506).

The problem for me was that I had not implemented my class correctly using:

namespace ns
{ 
    class Name
    {
    };
}

Although this most likely wasn't the reason for your error I would advise people to check this first as the previous answers got me thinking my problem was more advanced than it really was

Upvotes: 1

Keith D
Keith D

Reputation: 51

Check (manually) your .vcproj file for a <BrowseFileInformation></BrowseFileInformation> property tag in the configuration section for the configuration you are compiling. If your intermediate directory is the normal $(IntDir), then the empty property is telling the compilation to put the SBR files in the same directory as the source files, but the BSCMAKE command is looking for them in the $(IntDir) directory (and they aren't there).

Remove the <BrowseFileInformation></BrowseFileInformation> lines in the .vcproj file (you will have to do this by manually editing the file; setting properties in VS2010 or VS2008 won't do it)

Upvotes: 5

Yeeehhoo
Yeeehhoo

Reputation: 21

I get this problem by adding a new class into my project through the VS wizard.

I had to change the location of my "class.cpp" and "class.h", so I copy pasted them into the right directory. Then, I've added them into my project through the VS wizard with it's new path, and I finally get the BSCMAKE error after generating (and regenerating) my project. I had this error just after an other one, saying that my "class.cpp" couldn't be found.

I get the solution of my problems thanks to SVN. By comparing the current and the original version of my "project.vcproj" file, I realized that the class I added was setted with the old path, so it couldn't find the right one.

Hence, if you think that your error may have the same origin, what you have to do is: -Open your "project.vcproj" file in an editor -Search in the code where the path of your "class.cpp" is setted -Change it to the right one -Rebuild your project

It should work then

Upvotes: 2

Yochai Timmer
Yochai Timmer

Reputation: 49261

You can go to:
Configuration Properties -> C/C++ -> Browse Information

Remove the Enable Browse Information (Set it to No)

Upvotes: 7

Andrei Belogortseff
Andrei Belogortseff

Reputation: 1911

An .sbr file is used to keep the "browse information" for symbol browsing within the projects. It's created at the same time as its source .cpp file gets complied.

If VS cannot find an .sbr file, it means that the source .cpp was not compiled properly. Try to "rebuild" the project (rather than just "build" it), it may fix the error.

Upvotes: 6

Related Questions