Hi Toby,

This solves the problem for the minimal example, so I am confident that
this is the correct solution. Many thanks.

Thanks also to Martin who was seconds behind also with the correct answer!

John



On 05/07/11 11:41, Toby D. Young wrote:
> Hello John,
>
>> Makefile:125: lib/Makefile.dep: No such file or directory
>> =====cdG=======2d================== Remaking lib/Makefile.dep
>> =====cdG=======2d====debug========= ADEquation.cc
>> =====cdG=======2d====debug========= cdGMethod.cc
>> =====cdG=======2d================== Linking cdG-2d
>> lib/2d/cdGMethod.g.o: In function `cdGMethod':
>> /home/grads/tphj28/Dropbox/Documents/Research/JRC_papers_and_reports/CDG/CDG_code/min_test_2/source/cdGMethod.cc:17:
>> undefined reference to `ADEquation<2>::ADEquation()'
>> collect2: ld returned 1 exit status
>> make: *** [lib/cdG-2d] Error 1
> The project cc files know you have a template <dim>, but does not know
> what values dim can actually take; except that it will be an integer. You
> need to tell the machine to instantiate for the dim values you want to
> use; ie. 1, 2, 3, 4...
>
> To do that stick instantiations at the end of your cc files like this:
>
>> ADEquation.cc-------------------------------------------------------------------
>>
>> #include <dealii_includes.h>
>> #include <ADEquation.h>
>>
>> using namespace dealii;
>>
>> template <int dim>
>> ADEquation<dim>::ADEquation (void)
>> {}
> // Here are the instantiations:
> template class ADEquation<2>; // This is for 2d implementation.
> template class ADEquation<3>; // This is for 3d implementation.
>
> You only need to instantate dim (or any other template variables) for the
> ones you want to use. Of course, you will need to do that for all classes
> you have. Looks like you have a cdGMethod class to, is that <dim>
> dependent? If so, do it, if not, no.
>
> That should keep the linker happy.
> Clear?
>
> Best,
>       Toby
>
> -----
>
> Toby D. Young
> Assistant Professor
>
> Institute of Fundamental Technological Problems
> Polish Academy of Sciences
> ul Adolfa Pawinskiego 5b
> 02-106 Warsaw
> Poland
>
> www:   http://www.ippt.gov.pl/~tyoung
> skype: stenografia
>
> On Tue, 5 Jul 2011, John Chapman wrote:
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to