- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I meet a question. When I write a TBB program in console mode. It is running normally.But when I write a TBB program in clr windows form(this program is the same code under clr windows form and console mode). The compiler appear in the wrong information(error C2695).
" \Program Files\Intel\TBB\2.1\include\tbb\parallel_for.h(59) : error C2695
function1' overriding virtual function differs from 'function2' only by calling convention".
Where function1 is 'start_for
This problem confuse me. Does any reason cause this question? How should I solve it?
Thank you
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not completely sure that this will help, but for the sake of experiment try to do the following:
- Open file "tbb/parallel_for.h"
- Find the line:
/*override*/ void note_affinity( affinity_id id ) { - Change it to
/*override*/ void __TBB_EXPORTED_METHOD note_affinity( affinity_id id ) { - Save the changed file
- Rebuild your application
And, please, write us if it helped or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am so unexpected that the problem is happen.
Maybe I have not noticed some details of CLR windows form.
float* output;
size_t size;
public:
void operator () (const blocked_range
for(size_t i = r.begin(); i != r.end(); i++){
if(i == 0)
output = (input + input + input[i+1])/3;
else if(i == (size-1))
output = (input[i-1] + input + input)/3;
else
output = (input[i-1] + input + input[i+1])/3;
}
} // end operator()
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, I see what was the reason of your problem. You attempt to compile your .Net app in the "/clr:pure" mode. This won't work with the native library like TBB. Use the simple "/clr" option to compile your project. (And do not forget to remove that __TBB_EXPORTED_METOD qualifier from the "parallel_for.h" you've added recently.)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page