[omnetpp] error compiling in Linux

7 views
Skip to first unread message

Marc Llombart Soriano

unread,
Sep 13, 2007, 9:00:21 AM9/13/07
to omne...@omnetpp.org
Well, I supposed there wasn't enough information about the trouble, but I
really don't have much more.
On the screen, all the process goes well until getting this:
g++ -Wl,--export-dynamic ../Transport/Contract/TCPCommand_m.o
../Transport/Contract/TCPSocket.o ../Transport/Contract/TCPSocketMap.o
../Transport/Contract/UDPControlInfo_m.o ../Transport/Contract/UDPSocket.o
../Network/Contract/IPAddress.o ../Network/Contract/IPAddressResolver.o
../Network/Contract/IPControlInfo.o ../Network/Contract/IPControlInfo_m.o
../Network/Contract/IPProtocolId_m.o ../Network/Contract/IPv6Address.o
../Network/Contract/IPv6ControlInfo.o ../Network/Contract/IPv6ControlInfo_m.o
and more lots of lines similar to these. But as far as I'm concerned,
this appears when compiling under Windows and I think it's the correct
process.

But after that it appears (and I think here is the problem) lots of lines,
perhaps 60 times, saying the next:
ScenarioManager.cc:(.text+0x18d0): multiple definition of
`ScenarioManager::processAtCommand(cXMLElement*)'
../World/ScenarioManager.o:ScenarioManager.cc:(.text+0x18d0): first
defined here

Each time with a different .cc file. Perhaps is this, but I'm not able to
see the correlation between this and the linker problem.

Can someone help me?

Thank all you!!


Am Mittwoch, den 12.09.2007, 18:16 +0200 schrieb Marc Llombart Soriano:
> Hi all!
>
> I've developed a simulation using INET under a Windows environment (Visual
> C++ Express 2005) and everything is OK: it compiles and it runs properly.
> But my PC is a bit slow and my university has given me access to a very
> fast PC that runs under Linux.
>
> So, I've installed there everything, including INET. The "./makemake" runs
> properly, but when I run "make", at the end I got the next error:
>
> collect2: ld returned 1 exit status
> make[1]: *** [INET] Error 1
> make[1]: Leaving directory '\home\mllombart\INET-20061020\bin'
> make: *** [bin] Error 2
>
> It compiles separately each file, but when linking them it crashes. Does
> someone know what's happening?
>
> Thank you!!

post more debug messages from linker. Some lines more.

_______________________________________________
OMNeT++ Mailing List
options: http://lists.omnetpp.org/mailman/listinfo/omnetpp-l
archive: http://www.omnetpp.org/listarchive/index.php

Javier Celaya

unread,
Sep 13, 2007, 11:47:01 AM9/13/07
to OMNeT++ Discussion List
Really weird. It seems that (probably) all those .cc files are including
another one with the definition of that method. But in my source I can
only see it in World/ScenarioManager.cc

do a 'grep -r processAtCommand *' in the INET directory, to see which
files do contain the definition of that method.

It looks like a weird bug

--
Javier Celaya Alastrué
jcelaya AT unizar DOT es
Jabber: jcelaya AT pulsar DOT unizar DOT es
WEB: http://webdiis.unizar.es/~jcelaya

Departamento de Informática e Ingeniería de Sistemas
Centro Politécnico Superior - Universidad de Zaragoza
C/ María de Luna, 1, Ed. Ada Byron, 50018 Zaragoza (Spain)
Laboratorio L1.01, Tel: (+34) 976 76 24 72
Laboratorio L1.03b, Tel: (+34) 976 76 50 80

Marc Llombart Soriano

unread,
Sep 13, 2007, 12:53:50 PM9/13/07
to OMNeT++ Discussion List
I've run your command inside the INET directory and it appeared:

World/ScenarioManager.cc: processAtCommand(node);
World/ScenarioManager.cc:void
ScenarioManager::processAtCommand(cXMLElement *node)
World/ScenarioManager.h: void processAtCommand(cXMLElement *node);

Plus some html files from documentation that are not involved in the problem.
As I can see, in the .h file there is the declaration, and in the .cc file
there is a line calling the processAtCommand function and the code of the
function. Everything looks OK but the linker doesn't like it.

Under the Microsoft linker I get a warning saying multiple definitions
with this method but finally it creates the executable file and everything
runs ok. Why not in Linux? I have no idea what's happening. Obviously I
never modified that file.

Any ideas?

Reply all
Reply to author
Forward
0 new messages