5

I am trying to install netgen (build from source). Therefore Togl is needed and I installed it via

sudo apt-get install libtogl1 libtogl-dev

When typing 'make' I receive the following error messages:

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `Tk_InitStubs'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `tkStubsPtr'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `Tcl_InitStubs'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `tclStubsPtr'

Maybe Togl was not installed right. Is this an 32bit 64bit issu? What should I do to fix this?

user3528789
  • 103
  • 7
  • Error message says that you need to link with TCL and Tk too (add `-ltcl8.5 -ltk8.5` to link flags, set your correct version). – keltar Oct 13 '14 at 09:03

1 Answers1

5

This is an issue with linking to the correct versions of Tcl and Tk, as @keltar mentioned. If your goal is to build Netgen from source, your best bet is to stick with netgen-5.3.1, which works with tcl8.5 and tk8.5.

I ran into this issue because when I ran sudo apt-get install tcl-dev tk-dev, apt-get fetched tcl8.6 and tk8.6 for me. (If you search online for these issues you can see that these linking issues can sometimes be resolved by updating your Tcl/Tk version.) I uninstalled the default tcl-dev and tk-dev packages and installed tcl8.5-dev and tk8.5-dev instead.

Once you have the best fit version of Tcl/Tk, you can install Netgen from source. For example,

./configure --with-tclconfig=/usr/lib/tcl8.5/ --with-tkconfig=/usr/lib/tk8.5/
make
make install
olliezhu
  • 752
  • 1
  • 8
  • 17
  • 2
    More than two years after the OP pointed out this problem, the latest version of netgen still requires the user to install a deprecated version of Tcl//Tk. https://sourceforge.net/p/netgen-mesher/discussion/905306/thread/6b00b981/. – RHertel Feb 20 '16 at 17:40