[Gmsh] Problem on linking Gmsh to an existing project

Guilherme Praciano Karst Caminha gpkc at cin.ufpe.br
Fri Sep 6 02:35:04 CEST 2013


Hello,

I'm having a little trouble on linking GMSH to an existing project.
Here I have two problems:

1 - I'm also using FMDB on this project, so there IS class conflicts
(MVertex, GPoint...). As a solution, I've renamed Gmsh's class names to
something else like MVertexGMSH, GPointGMSH... But I don't think that's the
problem, since I've already done that and it worked before in the same
project.

The problem is that I'm trying to run my project on a RedHat server, so
it's a diferent computer. That brings us problem n 2:

2 - The linking process is returning me errors due undefined references
that I've never seen before when linking Gmsh (and I've already seen many
of these, but can't figure this one out...). So, the modified Gmsh compiles
fine, but looks like it doesn't want to get linked with my project.

I'm running under Red Hat Enterprise Linux Server release 5.3 (Tikanga).

So, I hope that someone can help me out... I really can't figure this out.

Here's the output:

make

Linking objects...
./libGmsh.a(GModel.cpp.o): In function `GModel::computeHomology()':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/GModel.cpp:2959:
undefined reference to `Homology::Homology(GModel*, std::vector<int,
std::allocator<int> >, std::vector<int, std::allocator<int> >, bool, bool,
bool, bool)'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/GModel.cpp:2967:
undefined reference to `Homology::findHomologyBasis()'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/GModel.cpp:2968:
undefined reference to `Homology::addChainsToModel(int, bool)'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/GModel.cpp:2969:
undefined reference to `Homology::addChainsToModel(int, bool)'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/GModel.cpp:2972:
undefined reference to `Homology::findCohomologyBasis()'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/GModel.cpp:2973:
undefined reference to `Homology::addCochainsToModel(int, bool)'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/GModel.cpp:2974:
undefined reference to `Homology::addCochainsToModel(int, bool)'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/GModel.cpp:2980:
undefined reference to `Homology::~Homology()'
./libGmsh.a(HomologyComputation.cpp.o): In function
`GMSH_HomologyComputationPlugin::execute(PView*)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Plugin/HomologyComputation.cpp:111:
undefined reference to `Homology::Homology(GModel*, std::vector<int,
std::allocator<int> >, std::vector<int, std::allocator<int> >, bool, bool,
bool, bool)'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Plugin/HomologyComputation.cpp:114:
undefined reference to `Homology::findHomologyBasis()'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Plugin/HomologyComputation.cpp:115:
undefined reference to `Homology::findCohomologyBasis()'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Plugin/HomologyComputation.cpp:119:
undefined reference to `Homology::addChainsToModel(int, bool)'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Plugin/HomologyComputation.cpp:120:
undefined reference to `Homology::addCochainsToModel(int, bool)'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Plugin/HomologyComputation.cpp:123:
undefined reference to `Homology::~Homology()'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`VectorSpaceCat<Chain<int>, int>::operator-=(Chain<int> const&)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:120:
undefined reference to `vtable for ElemChain'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:120:
undefined reference to `vtable for ElemChain'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`std::_Rb_tree<ElemChain, std::pair<ElemChain const, int>,
std::_Select1st<std::pair<ElemChain const, int> >, std::less<ElemChain>,
std::allocator<std::pair<ElemChain const, int> >
>::_M_copy(std::_Rb_tree_node<std::pair<ElemChain const, int> > const*,
std::_Rb_tree_node<std::pair<ElemChain const, int> >*)':
/usr/include/c++/4.1.2/bits/stl_tree.h:1226: undefined reference to `vtable
for ElemChain'
/usr/include/c++/4.1.2/bits/stl_tree.h:1238: undefined reference to `vtable
for ElemChain'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`Chain<int>::operator+=(Chain<int> const&)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:436:
undefined reference to `vtable for ElemChain'
./libGmsh.a(HomologyPostProcessing.cpp.o):/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:436:
more undefined references to `vtable for ElemChain' follow
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`Chain<int>::operator+=(Chain<int> const&)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:436:
undefined reference to `ElemChain::compareOrientation(ElemChain const&)
const'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`std::_Rb_tree<ElemChain, std::pair<ElemChain const, int>,
std::_Select1st<std::pair<ElemChain const, int> >, std::less<ElemChain>,
std::allocator<std::pair<ElemChain const, int> >
>::insert_unique(std::pair<ElemChain const, int> const&)':
/usr/include/c++/4.1.2/bits/stl_tree.h:927: undefined reference to `vtable
for ElemChain'
/usr/include/c++/4.1.2/bits/stl_tree.h:931: undefined reference to `vtable
for ElemChain'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`GMSH_HomologyPostProcessingPlugin::execute(PView*)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Plugin/HomologyPostProcessing.cpp:277:
undefined reference to `ElemChain::_vertexCache'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`std::vector<Chain<int>, std::allocator<Chain<int> >
>::push_back(Chain<int> const&)':
/usr/include/c++/4.1.2/bits/stl_vector.h:606: undefined reference to
`vtable for ElemChain'
/usr/include/c++/4.1.2/bits/stl_vector.h:606: undefined reference to
`vtable for ElemChain'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function `int
incidence<int>(Chain<int> const&, Chain<int> const&)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:319:
undefined reference to `ElemChain::compareOrientation(ElemChain const&)
const'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`Chain<int>::Chain(GModel*, int)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:265:
undefined reference to `ElemChain::ElemChain(MElement*)'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`Chain<int>::getBoundary() const':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:347:
undefined reference to `ElemChain::getNumBoundaryElemChains() const'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:347:
undefined reference to `ElemChain::getBoundaryElemChain(int) const'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:347:
undefined reference to `ElemChain::getNumBoundaryElemChains() const'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`Chain<int>::addElemChain(ElemChain const&, int)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:424:
undefined reference to `vtable for ElemChain'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:424:
undefined reference to `vtable for ElemChain'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:424:
undefined reference to `vtable for ElemChain'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:426:
undefined reference to `ElemChain::compareOrientation(ElemChain const&)
const'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`Chain<int>::addToModel(GModel*, bool) const':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:464:
undefined reference to `ElemChain::createMeshElement() const'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:472:
undefined reference to `ElemChain::createMeshElement() const'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`std::_Rb_tree<ElemChain, std::pair<ElemChain const, int>,
std::_Select1st<std::pair<ElemChain const, int> >, std::less<ElemChain>,
std::allocator<std::pair<ElemChain const, int> >
>::operator=(std::_Rb_tree<ElemChain, std::pair<ElemChain const, int>,
std::_Select1st<std::pair<ElemChain const, int> >, std::less<ElemChain>,
std::allocator<std::pair<ElemChain const, int> > > const&)':
/usr/include/c++/4.1.2/bits/stl_tree.h:800: undefined reference to `vtable
for ElemChain'
/usr/include/c++/4.1.2/bits/stl_tree.h:800: undefined reference to `vtable
for ElemChain'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`Chain<int>::Chain(Chain<int> const&)':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:65536:
undefined reference to `vtable for ElemChain'
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:65536:
undefined reference to `vtable for ElemChain'
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`__gnu_cxx::__normal_iterator<Chain<int>*, std::vector<Chain<int>,
std::allocator<Chain<int> > > >
std::__uninitialized_copy_aux<__gnu_cxx::__normal_iterator<Chain<int>*,
std::vector<Chain<int>, std::allocator<Chain<int> > > >,
__gnu_cxx::__normal_iterator<Chain<int>*, std::vector<Chain<int>,
std::allocator<Chain<int> > > > >(__gnu_cxx::__normal_iterator<Chain<int>*,
std::vector<Chain<int>, std::allocator<Chain<int> > > >,
__gnu_cxx::__normal_iterator<Chain<int>*, std::vector<Chain<int>,
std::allocator<Chain<int> > > >, __gnu_cxx::__normal_iterator<Chain<int>*,
std::vector<Chain<int>, std::allocator<Chain<int> > > >, __false_type)':
/usr/include/c++/4.1.2/bits/stl_uninitialized.h:86: undefined reference to
`vtable for ElemChain'
./libGmsh.a(HomologyPostProcessing.cpp.o):/usr/include/c++/4.1.2/bits/stl_uninitialized.h:86:
more undefined references to `vtable for ElemChain' follow
./libGmsh.a(HomologyPostProcessing.cpp.o): In function
`Chain<int>::getTrace(GModel*, std::vector<int, std::allocator<int> >
const&) const':
/net/home/A-home/lyra/rogerio/scientific_applications/gmshGMSH/Geo/Chain.h:387:
undefined reference to `ElemChain::inEntity(GEntityGMSH*) const'
make: [PADMEC_AMR.exe] Error 1 (ignored)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130905/15302779/attachment.html>