OMNeT++: Error during startup: No user interface (Cmdenv, Tkenv, etc.) found

This entry was posted by on Wednesday, 7 December, 2011 at

After an update of GCC (on Kubuntu 11.10) this error shows up when running simulations after recompilation.

Luckily, this has been remedied in the new 4.2 version but there is a quick workaround for 4.1:

It seems GCC 4.6 now decides not to include some unneeded libraries if no symbols from it were referenced. Unfortunately, at runtime they turn out to be quite needed (heck, no env means no simulation ;).

The same problem may occur when linking against omnetpp, mixim or even your own libraries; so not just the env libs. For instance, I have a database module which exports scalars etc. to a database. Linking against this module (with the -l option) used to work but since gcc 4.6 it shows the same behaviour as the env libraries from OMNeT++. The solution could be either:

  • Manually edit your Makefiles (not recommended)
  • Edit omnetpp’s “configure.user”: find LDFLAGS and change it to: LDFLAGS=”-Wl,–no-as-needed” (or include the stuff between the quotes if you already have something there). Also, don’t forget to uncomment it. ./configure and make. Then make your own MiXiM or derivative (my dacs_mixim pulls in OMNeT’s config just like MiXiM does with the “make -f makemakefiles” command. Then make and all is done.

Edit: OMNeT++ 4.2’s configure.user now contains the LDFLAGS=”-Wl,–no-as-needed” which should also fix the problem with the Cmdenv and Tkenv.

One Response to “OMNeT++: Error during startup: No user interface (Cmdenv, Tkenv, etc.) found”

  1. Scott

    Thank you very much!!

Leave a Reply