- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am currently usingTBB 2.1inVisualStudio2005sp1 under WinXP SP2, with the Intel official VS plug-in for TBB.
I am quite sureI has installed the TBBlibrary and the VS plug-in properly, and I have written some codes with TBB[not containing the concurrent_vector] that compiled and run successfullyin VS. And here is a special case I cannot solve nor can I find any reference from the turtorial or manual. It is playing withpointers to the concurrent_vector, compiled with debug version.
#include "tbb/concurrent_vector.h"
typedef tbb::concurrent_vectorcvi;
class myc{
private: static cvi *s;
public: static void stat_init( cvi* );
};//myc
cvi myc::*s;
void myc::stat_init( cvi* ous ){ s=ous; }
int main( int argc, char *argv[] )
{
cvi c;
c.push_back(0);
myc obj;
myc::stat_init(&c);
return 0;
}//main() end
For the above piece of code, the VS compiler generates the message "Error1error LNK2001: unresolved external symbol "private: static class tbb::concurrent_vector
" .
And, if Ichange all the pointersto objects as the following, compiling and linking will be no problem[also in debug versi], but it pops up with some errors message "msvcp80d.dll cannot be found."
#include "tbb/concurrent_vector.h"
typedef tbb::concurrent_vectorcvi;
class myc{
private: static cvi s;
public: static void stat_init( cvi );
};//myc
cvi myc::s;
void myc::stat_init( cvi ous ){ s=ous; }
int main( int argc, char *argv[] )
{
cvi c;
c.push_back(0);
myc obj;
myc::stat_init(c);
return 0;
}//main() end
Could anyone help? Thank you. I have tried looking into the docs, but found no useful info.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cvi* myc::s;
And this:
cvi myc::*s;is a declaration of global variable of type pointer to member.
Btw, following:
void myc::stat_init( cvi* ous ){ s=ous; }
looks a bit senseless. Maybe you meant:void myc::stat_init( cvi*& ous ){ s=ous; }
?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cvi* myc::s;
And this:
cvi myc::*s;is a declaration of global variable of type pointer to member.
Btw, following:
void myc::stat_init( cvi* ous ){ s=ous; }
looks a bit senseless. Maybe you meant:void myc::stat_init( cvi*& ous ){ s=ous; }
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
timminn:Thank you for your help. But the run-time error message "msvcp80d.dll not found" still keeps poping up
You must enable manifest generation. Project Properties -> Linker -> Manifest file -> Generate Manifest -> Yes.
It must be enabled by default when you create new project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
timminn:Thank you again. But it does not work.
Check: Project Properties -> C/C++ -> Code Generation -> Runtime Library. There must be Multi-threaded Debug DLL for debug build, and Multi-threaded DLL for release build. You can get the error, if you are using static runtime.
Did you created new project from scratch? If no, try to create new project from scratch. Because on my MSVC2005SP1 it works perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
timminn:
Thank you again. But it does not work.
Check: Project Properties -> C/C++ -> Code Generation -> Runtime Library. There must be Multi-threaded Debug DLL for debug build, and Multi-threaded DLL for release build. You can get the error, if you are using static runtime.
Did you created new project from scratch? If no, try to create new project from scratch. Because on my MSVC2005SP1 it works perfectly.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page