OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000418OMNeT++command line toolspublic2011-10-19 12:092011-10-19 12:16
rhornig 
rhornig 
normalmajoralways
resolvedfixed 
4.2rc1 
4.2 
0000418: No user interface (Cmdenv, Tkenv, etc.) found when compiling with GCC 4.6 in Ubuntu 11.10
When running any simulation the following error appears:

<!> Error during startup: No user interface (Cmdenv, Tkenv, etc.) found.

ldd <program> shows that neither libcmdenv.so nor libtkenv.so is linked with the executable.
No tags attached.
Issue History
2011-10-19 12:09rhornigNew Issue
2011-10-19 12:14rhornigNote Added: 0000572
2011-10-19 12:16rhornigNote Added: 0000573
2011-10-19 12:16rhornigStatusnew => resolved
2011-10-19 12:16rhornigFixed in Version => 4.2
2011-10-19 12:16rhornigResolutionopen => fixed
2011-10-19 12:16rhornigAssigned To => rhornig

Notes
(0000572)
rhornig   
2011-10-19 12:14   
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
(0000573)
rhornig   
2011-10-19 12:16   
Workaround for omnetpp 4.1:
In Makefile.inc.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

then

./configure
make clean
make