View Issue Details

IDProjectCategoryView StatusLast Update
0003653OpenFOAMBugpublic2021-04-02 08:38
Reporterhandrake0724Assigned Tohenry 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
Product Versiondev 
Fixed in Version 
Summary0003653: missing symbols for Function1 class in
DescriptionI got the following errors while compiling my code which is using Function1 class:

  undefined reference to `Foam::Function1<double>::write(Foam::Ostream&) const'
  undefined reference to `Foam::Function1<Foam::Vector<double> >::write(Foam::Ostream&) const'

I examined in dev with version 8 and found there are missing symbols in
with the following command
    nm | awk '{print $3}' | c++filt | grep 'Function1<.*::write'

OpenFOAM 8 gives the following results:
Foam::RegisterDebugSwitch<Foam::Function1<double> >::writeData(Foam::Ostream&) const
Foam::RegisterDebugSwitch<Foam::Function1<int> >::writeData(Foam::Ostream&) const
Foam::RegisterDebugSwitch<Foam::Function1<Foam::SymmTensor<double> > >::writeData(Foam::Ostream&) const
Foam::RegisterDebugSwitch<Foam::Function1<Foam::SphericalTensor<double> > >::writeData(Foam::Ostream&) const
Foam::RegisterDebugSwitch<Foam::Function1<Foam::Tensor<double> > >::writeData(Foam::Ostream&) const
Foam::RegisterDebugSwitch<Foam::Function1<Foam::Vector<double> > >::writeData(Foam::Ostream&) const

Foam::Function1<double>::writeData(Foam::Ostream&) const
Foam::Function1<int>::writeData(Foam::Ostream&) const

Foam::Function1<Foam::SymmTensor<double> >::writeData(Foam::Ostream&) const
Foam::Function1<Foam::SphericalTensor<double> >::writeData(Foam::Ostream&) const
Foam::Function1<Foam::Tensor<double> >::writeData(Foam::Ostream&) const
Foam::Function1<Foam::Vector<double> >::writeData(Foam::Ostream&) const

I expected the same results with write(Foam::Ostream&) const instead of writeData member function like
  Foam::Function1<double> ::write(Foam::Ostream&) const
  Foam::Function1<Foam::Vector<double>>::write(Foam::Ostream&) const

but OpenFOAM dev gave nothing.

I studied Function1 source codes and macros but could not find something strange yet.
are the missing symbols the intended results?
TagsNo tags attached.



2021-04-02 08:38

manager   ~0011958

> undefined reference to `Foam::Function1<double>::write(Foam::Ostream&) const'

Of course, Function1 is an abstract base class and the write function is pure virtual:

        //- Write data to dictionary stream
        virtual void write(Ostream& os) const = 0;


2021-04-02 08:38

manager   ~0011959

User support request

Issue History

Date Modified Username Field Change
2021-04-02 03:24 handrake0724 New Issue
2021-04-02 08:38 henry Note Added: 0011958
2021-04-02 08:38 henry Assigned To => henry
2021-04-02 08:38 henry Status new => closed
2021-04-02 08:38 henry Resolution open => no change required
2021-04-02 08:38 henry Note Added: 0011959