- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using the TBB CMake config as per those in the archive of 2021.7.0
find_package(TBB 2020 REQUIRED)
add_executable(tbbi
main.cpp)
target_link_libraries(tbbi
TBB::tbb)
However, when I compile it, it errors out and appears to be using the systems header instead of the one I provided via the TBB_DIR directive
I am building my application on Ubuntu 18.04
[ 50%] Building CXX object CMakeFiles/tbbi.dir/main.cpp.o
In file included from /usr/include/tbb/task_scheduler_init.h:24:0,
from /home/nyue/projects/CMakeQuestions/CMakeQuestions_git/HowToIncludeTBBInInstalPackage/main.cpp:2:
/usr/include/tbb/tbb_stddef.h:409:14: error: expected type-specifier before ‘split’
operator split() const { return split(); }
^~~~~
CMakeFiles/tbbi.dir/build.make:75: recipe for target 'CMakeFiles/tbbi.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/tbbi.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/tbbi.dir/all' failed
make[1]: *** [CMakeFiles/tbbi.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
Are there other targets I should use or do I need to augment the target provided by TBB config with specific <>_INCLUDE_DIRS ?
Kind regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I figured out my own error. I was looking at some old TBB example that still include the now deprecated and removed header "task_scheduler_init.h" and hence it is pick up the that file.
I should not include that file in the first place.
I have studied new TBB example and the issue is resolved.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I figured out my own error. I was looking at some old TBB example that still include the now deprecated and removed header "task_scheduler_init.h" and hence it is pick up the that file.
I should not include that file in the first place.
I have studied new TBB example and the issue is resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in intel communities and sharing the solution with us.
Glad to know that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks & Regards,
Noorjahan.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page