P
Pallav singh
Hi All ,
while compiling the following code my compiler gives me error message
" boost/smart_ptr.h: No such file or directory" . do i need to give
some comiplation option for it ...such as where to find header file
#include<iostream>
#include "boost/smart_ptr.h"
using namespace std;
class A
{
int a,b;
public :
void printf()const
{ cout<<" value of a "<<a <<"Value of b "<<b <<endl ;}
};
int main()
{
boost::shared_ptr< A > sample(new A);
printf("The Sample now has %i references\n", sample.use_count());
boost::shared_ptr< A > sample2 = sample;
printf("The Sample now has %i references\n", sample.use_count());
sample.reset();
printf("The Sample now has %i references\n", sample2.use_count());
return 0;
}
Thanks
Pallav Singh
while compiling the following code my compiler gives me error message
" boost/smart_ptr.h: No such file or directory" . do i need to give
some comiplation option for it ...such as where to find header file
g++ -g file.cc
#include<iostream>
#include "boost/smart_ptr.h"
using namespace std;
class A
{
int a,b;
public :
void printf()const
{ cout<<" value of a "<<a <<"Value of b "<<b <<endl ;}
};
int main()
{
boost::shared_ptr< A > sample(new A);
printf("The Sample now has %i references\n", sample.use_count());
boost::shared_ptr< A > sample2 = sample;
printf("The Sample now has %i references\n", sample.use_count());
sample.reset();
printf("The Sample now has %i references\n", sample2.use_count());
return 0;
}
Thanks
Pallav Singh