kiriloff
kiriloff

Reputation: 26333

Intel TBB integration issue - VS2013 Compilation error in Google Test project

I have a VS2013 solution with this structure:

There is a build dependency of gtestalgo project on algo project.

algo projects alone builds successfully. algo project includes Intel TBB: the Linker properties contain Additional Library Directory "$(tbb_path)\lib\intel64\$(tbb_subdir)" and input "tbb.lib".

gtestalgo project does not compile. Errors are all related to TBB. More precisely, errors refer to files in algo project where TBB is not recognized, ex "TBB is not a class or namespace name". gtestalgo project has got ../algo as an Additional Include Directory, where ../algo contains all source and header files for algo project. gtestalgo project links the library algo.lib, and Linker Additional Library Directory and Input are correctly set. Sources in gtestalgo project include several header files from algo project: #include "algo_main.h", etc...

I tried to Link TBB to gtestalgo project (with same Linker properties as in the algo project), and I also tried to remove this Link. In both cases, compilation errors are the same.

Upvotes: 0

Views: 487

Answers (2)

kiriloff
kiriloff

Reputation: 26333

You can include it directly with something like #include "../algo/stdafx.h" (in gtestalgo/stdafx.h if there is one).

This is enough to solve the issue. Some includes in the stdafx precompiled header in the algo project were not visible to the gtestalgo project.

Upvotes: 0

Anton
Anton

Reputation: 6537

Sources in gtestalgo project include several header files from algo project: #include "algo_main.h", etc...

It suggests that if Algo header files include TBB, including such Algo headers into GTestAlgo project brings dependency upon TBB into it.

Since the Algo project compiles well, I conclude that it sets Include directories correctly so TBB headers can be found.

But I don't see in your description how Include directories are set in GTestAlgo project. Set them the same way with respect to TBB location and it will likely compile fine.

Upvotes: 1

Related Questions