[Gmsh] Error linking

Agnese, Marco m.agnese13 at imperial.ac.uk
Wed Feb 5 20:20:17 CET 2014


Hello GMSH,
I am trying to compile a simple code which uses GMSH API. 
I compiled the GMSH source as:

cmake -DDEFAULT=0 -DENABLE_BUILD_LIB=1 -DENABLE_BUILD_SHARED=1 -DENABLE_BUILD_DYNAMIC=1 -DCMAKE_INSTALL_PREFIX=../lib_install ..
make lib
make shared
make install/fast

and everything it is fine.
When I compile my code with the command 

g++ -c -m64 -pipe -O2 -Wall -W -fPIE  -I/usr/share/qt5/mkspecs/linux-g++-64 -I../gmsh_test -I../../gmsh-2.8.3-source/lib_install/include/gmsh -I. -o main.o ../gmsh_test/main.cpp

and link with the command

g++ -m64 -Wl,-O1 -o gmsh_test main.o   -L/home/ma2413/gmsh_test/gmsh_test/../../gmsh-2.8.3-source/lib_install/lib/ -lGmsh 

I obtain the following errors

$HOME/gmsh_test/gmsh_test/../../gmsh-2.8.3-source/lib_install/lib//libGmsh.so: undefined reference to "typeinfo for Field"
$HOME/gmsh_test/gmsh_test/../../gmsh-2.8.3-source/lib_install/lib//libGmsh.so:undefined reference to "FieldManager::get(int)"

I don't know what I am doing wrong.

Thank you very much,
regards,
Marco.