Visual Studio does not find boost, including files in release mode (works in debugging)

I am using boost with Visual Studio 2013 Express.

Visual Studio finds #include <boost/filesystem.hpp> in debug mode, but not in release mode.

When I try to compile in Release mode, it says:

Error 1 error C1083: Cannot open include file: 'boost/filesystem.hpp': No such file or directory

When I right-click on the #include directive to open the file manually, it works in the Debug configuration, but again not in Release, it says:

File 'boost/filesystem.hpp' not found in current source file directory or in build system paths.

I checked build configurations and

  • C / C ++ โ†’ General โ†’ โ€œAdditional Include Directoriesโ€
  • Linker โ†’ General โ†’ "Additional Library Directories"
  • Linker โ†’ Input โ†’ "Additional Dependencies"

The same goes for both configurations.

Do I need to edit the "build system paths" as the error says? I thought this is what the three options above do.

What else could cause this problem?

+6
source share
2 answers

Double check that you checked the project settings that could not be created. I had the same problem when using boost :: optional. I just overlooked that another project (UnitTests) was failing, and not a project that I suspected (CppPlaygroundLib) due to misinterpretation of the assembly output, focusing on the line containing the error message:

1> ------ Started creating: Project: UnitTests , Configuration: Release Win32 ------

1> FooTests.cpp

1> c: \ projects \ playground \ cppplayground \ cppplaygroundlib \ foo.h (3): fatal error C1083: unable to open include file: boost / optional / optional.hpp: No such file or directory

========== Build: 0 succeeded, 1 failed, 2 updated, 0 skipped ===========

After I added the missing boost path in C / C ++ -> General-> Additional Include Directories, my solution compiled successfully.

+1
source

The project property pages in Visual Studio do not match for both configurations. On the properties page, simply set Configuration (top left) to free and set the configuration to build the release independently.

0
source

All Articles