I added at the end of ibvp.h: 
typedef ibvp<3> ibvp_obj; 

I added at the end of ibvp.cc: 
template class ibvp<3>;

Then in main.cc, I create the object as
ibvp_obj irradiation;

It is still returning exactly the same error of undefined reference. 

/home/sabyasachi/Documents/current_research/irradiated_materials/irradiated_tension_engg_400C/main.cc:96:
 
error: undefined reference to 'ibvp<3>::ibvp()'
/home/sabyasachi/Documents/current_research/irradiated_materials/irradiated_tension_engg_400C/main.cc:98:
 
error: undefined reference to 'ibvp<3>::run()'
/home/sabyasachi/Documents/current_research/irradiated_materials/irradiated_tension_engg_400C/main.cc:128:
 
error: undefined reference to 'ibvp<3>::~ibvp()'
/home/sabyasachi/Documents/current_research/irradiated_materials/irradiated_tension_engg_400C/main.cc:128:
 
error: undefined reference to 'ibvp<3>::~ibvp()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/main.dir/build.make:132: main] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/main.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I also tried template class ibvp_obj<3> at the end of .cc but still the 
same error. 
On Wednesday, August 30, 2023 at 9:59:05 PM UTC+5:30 Wolfgang Bangerth 
wrote:

> On 8/30/23 00:22, sabyasachi chatterjee wrote:
> > 
> > 
> /home/sabyasachi/Documents/current_research/irradiated_materials/irradiated_tension_engg_400C/main.cc:96:
>  
>
> > error: undefined reference to 'ibvp<3>::ibvp()'
>
> You will likely have to add 'explicit instantiations' to the bottom of 
> the .cc file. Like here:
>
> https://stackoverflow.com/questions/2351148/explicit-template-instantiation-when-is-it-used
>
> Best
> W.
>
> -- 
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/2bd60445-4b14-424e-bb05-bf07cc73d405n%40googlegroups.com.

Reply via email to