Tkenv ERROR - Omnet++ 4.6 and Ubuntu 14.04 LTS (INET Framework 2.6)

Skip to first unread message

Pasquale Di Dio

Jul 25, 2015, 3:26:09 PM7/25/15
to OMNeT++ Users
Hi Guys,

I have this error message when I star a simulation in Tkenv :

<!> Error during startup: Could not start user interface 'Tkenv'.
OMNeT++ Discrete Event Simulation  (C) 1992-2014 Andras Varga, OpenSim Ltd.
Version: 4.6, build: 141202-f785492, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

User interface 'Tkenv' not found (not linked in or loaded dynamically).
Available ones are:
  Cmdenv : command-line user interface



If I start the simulation only in Command Line user interface it works perfectly!

I already looked for a solution, founding this :


that say :
gcc 4.6 does not add the shared lib to the executable if no symbols from it are referenced. This is a deviation from earlier gcc behavior (they always added the shared library). 

gcc 4.6 adds the --as-needed option to the linker (ld) command line so we need to turn that off. 

Fix: add --no-as-needed in front of the library


That say (by "Rudolf Hornig") :

"normally the tk and cmdenv is linked directly with the model, however recent changes(or bugs) in ld / gcc cause that the shared libs are optimized out.
Here is the solution:

In find the following lines (towards the end):
CMDENV_LIBS = -u _cmdenv_lib -loppcmdenv$D -loppenvir$D                                               
TKENV_LIBS = -u _tkenv_lib -lopptkenv$D -loppenvir$D -lopplayout$D                                    

and replace them with:
CMDENV_LIBS = -u _cmdenv_lib -Wl,--no-as-needed -loppcmdenv$D -loppenvir$D                                               
TKENV_LIBS = -u _tkenv_lib -Wl,--no-as-needed -lopptkenv$D -loppenvir$D -lopplayout$D                                    

make clean

This should work with all omnet 4.x version. Spread the info for other users suffering from the issue.

but no way! It doesn't work.

Can you please help me!?
Under Windows 7 it works perfectly, but I have to migrate on Ubuntu for my thesis!
Thank you in advande.

Francisco Estevez

Jul 27, 2015, 2:12:06 AM7/27/15
to OMNeT++ Users,
There are two different possibilities:

- You don't have TKenv properly installed 
- You don't have TKenv in your path

Did you check both?


Pasquale Di Dio

Jul 27, 2015, 5:37:52 AM7/27/15
to OMNeT++ Users,
Hi Fran;

Thanks for your reply.

I've checked my TKenv path, and it is : Home-->omnetpp-4.6-->src-->tkenv.

I don't know how to check if TKenv is properly installed; can you show me please?

I'm a NOOB in Ubuntu O.S. ... you've to be "patience" :)

Reply all
Reply to author
0 new messages