Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

errors while compiling tbb

xinyuhou
Beginner
742 Views

I am totally new to tbb. Just followed the doc "getting started" and tried the parallel for example which works fine. When I tried to add tbb into my own project there were several compiling errers which will be listed in the end. All I did was just adding #include"tbb/parallel_for.h" and #include "tbb/blocked_range.h" into one of my cpp file where was the place I am gonna do parallel.

Thanks in advance

Jerry

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(44) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(44) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(53) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(53) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(59) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(59) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(65) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(65) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(71) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(71) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(92) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(93) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(94) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(110) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(92) : error C2059: syntax error : '{'

1> c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(135) : see reference to class template instantiation 'tbb::tbb_allocator' being compiled

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(92) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(93) : error C2059: syntax error : '{'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(93) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(94) : error C2059: syntax error : '{'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(94) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(110) : error C2059: syntax error : '{'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(110) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(182) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(183) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(185) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(182) : error C2059: syntax error : '{'

1> c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(192) : see reference to class template instantiation 'tbb::zero_allocator' being compiled

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(182) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(183) : error C2065: 'a' : undeclared identifier

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(183) : error C2056: illegal expression

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(183) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(183) : error C2473: '' : looks like a function definition, but there is no parameter list.

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_allocator.h(184) : error C2143: syntax error : missing ';' before 'template'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(153) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(153) : error C2059: syntax error : '='

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(153) : error C2238: unexpected token(s) preceding ';'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(158) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(158) : error C2059: syntax error : '='

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(158) : error C2238: unexpected token(s) preceding ';'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(168) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(168) : error C2059: syntax error : '='

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(168) : error C2238: unexpected token(s) preceding ';'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(171) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(171) : error C2059: syntax error : '='

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(171) : error C2238: unexpected token(s) preceding ';'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(153) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(158) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(168) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(171) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(204) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(215) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(218) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(224) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(227) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(229) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(230) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(204) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(215) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(218) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(224) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(227) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(229) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(230) : error C2059: syntax error : ','

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(267) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(274) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(284) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(286) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(288) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(290) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(293) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(302) : warning C4003: not enough actual parameters for macro 'throw'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(268) : error C2065: 'src' : undeclared identifier

1> c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(323) : see reference to class template instantiation 'tbb::movable_exception' being compiled

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(269) : error C2056: illegal expression

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(269) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(269) : error C2061: syntax error : identifier 'src'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(270) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(270) : error C2059: syntax error : 'constant'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(271) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(271) : error C2061: syntax error : identifier 'src'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(272) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(272) : error C2143: syntax error : missing ';' before '{'

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(272) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body

1>c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(323) : fatal error C1075: end of file found before the left brace '{' at 'c:\\program files (x86)\\intel\\composer xe 2011 sp1\\tbb\\include\\tbb\\tbb_exception.h(120)' was matched

0 Kudos
4 Replies
SergeyKostrov
Valued Contributor II
742 Views
Quoting xinyuhou
...
1>c:\program files (x86)\intel\composer xe 2011 sp1\tbb\include\tbb\tbb_exception.h(44) : warning
C4003: not enough actual parameters for macro 'throw'
1>c:\program files (x86)\intel\composer xe 2011 sp1\tbb\include\tbb\
tbb_exception.h(44) : error C2059:
syntax error : ','
1>c:\program files (x86)\intel\composer xe 2011 sp1\tbb\include\tbb\tbb_exception.h(53) : warning
C4003: not enough actual parameters for macro 'throw'
1>c:\program files (x86)\intel\composer xe 2011 sp1\tbb\include\tbb\
tbb_exception.h(53) : error C2059:
syntax error : ','
...

Could you provide more technical details?What version of TBB is installed on your computer? WhatVisual Studio do you use?

I've looked at 'tbb_exception.h' header and on lines 44 and 53 ( andabove as well) I don't see any "wrong" codes
that could break the compilation ( TBB v4 Update 3 ).

Also, could you check if you have an STL file 'stdexcept' in '..\Include' folder of a Visual Studio? I think you have or
you would have an error '...can't open a file...' Anyway, please check.

Best regards,
Sergey
0 Kudos
xinyuhou
Beginner
742 Views
Hi Sergey

I have no idea what is relevant to this issue, the only thing I did was just including 2 header file from tbb. And I compared the sample and my codemost of the stuff are the same except the example is developed on the console and mine is a window app.There is stdexcept filein the including folder of my vs2008.Theversion of tbb istbb40_297oss_win, guess it is relevantly new.

Thanks for the replying I am still working on this problem hope you can offer me more help

Thanks in advance

Jerry
0 Kudos
SergeyKostrov
Valued Contributor II
742 Views
Quoting xinyuhou
Hi Sergey

I have no idea what is relevant to this issue, the only thing I did was just including 2 header file from tbb. And I compared the sample and my codemost of the stuff are the same except the example is
developed on the console and mine is a window app...

I think you have a conflict between Windows headers and TBB headers and it is possibly related to are-defined
declaration of a'throw' method / function, or the whole class that is responsible for handling exceptions.

I would suggest two ways of investigating what could bewrong:

1. Create an empty Win32 Console project and start adding some components ( your headers andclasses, TBB headers,etc )
one at a time with a compilation after every addition / modification

2. Create an empty Win32Windows project and start adding some components ( your headers andclasses, TBB headers,etc )
one at a time with a compilation after every addition / modification

Could you upload a test-project to reproduce the problem? Sorry, I can't suggest anything else and please keepus
informed on your progress.

Best regards,
Sergey
0 Kudos
xinyuhou
Beginner
742 Views
Finally find where the problem is. Like Sergey said it because of the conflict defination of throw.

Thank you Sergey

Jerry
0 Kudos
Reply