I have a program that relies on several include files. When I define includes in the order shown below the program compiles fine.
#include <iostream>
#include "opencv2/cvconfig.h"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/internal.hpp" // For TBB wrappers
#include "arrayfire.h"
However, when I switch the last two includes as shown below
#include <iostream>
#include "opencv2/cvconfig.h"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "arrayfire.h"
#include "opencv2/core/internal.hpp" // For TBB wrappers
I get compiler errors:
1>d:\libraries\tbb41\tbb41_20130613oss\include\tbb\task.h(765): error C2059: syntax error : '{' 1>d:\libraries\tbb41\tbb41_20130613oss\include\tbb\task.h(765): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
This is unexpected and I'd like to fix it. All of the includes are from libraries (OpenCV and ArrayFire). Any suggestions on what may be the cause and how to fix this issue?
Edit Here's the relevant part of task.h:
759 #if __TBB_TASK_GROUP_CONTEXT
760 //! This method is deprecated and will be removed in the future.
761 /** Use method group() instead. **/
762 task_group_context* context() {return prefix().context;}
763
764 //! Pointer to the task group descriptor.
765 task_group_context* group () { return prefix().context; }
766 #endif /* __TBB_TASK_GROUP_CONTEXT */
In line 765, the IDE complains about {
, saying Error: expected an identifier