GIDForums  

Go Back   GIDForums > Computer Programming Forums > CPP / C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Mar-2007, 23:35
newbie06 newbie06 is offline
New Member
 
Join Date: Oct 2006
Posts: 21
newbie06 is on a distinguished road

gnu.linkonce undefined reference


Hi all,

I am using ns2 as my simulator, but I think this problem is related with c++. I am facing a problem during compilation process in which I got several pages of errors. Some of them are listed below (I cannot paste all here because it is too long, howver, the errors are quite the same, complaining about the .gnu.linkonce and undefine reference):

Code:
sctp/mhsctp.o: (gnu.linkonce.d__vt-11MhSctpAgent+0x90): undefined reference to ‘sctpAgent::SendBufferDequeueUpTo(unsigned int)’ sctp/mhsctp.o: (gnu.linkonce.d__vt-11MhSctpAgent+0x94): undefined reference to ‘sctpAgent::FastRtx(void)’ sctp/mhsctp.o: (gnu.linkonce.d__vt-11MhSctpAgent+0x98): undefined reference to ‘sctpAgent::RtxMarkedChunks(SctpRtxLimit_E)’ sctp/mhsctp.o: (gnu.linkonce.d__vt-11MhSctpAgent+0x90): undefined reference to ‘sctpAgent::ProcessGapAckBlocks(unsigned char*, Boolean_E)’ sctp/mhsctp.o: (gnu.linkonce.d__vt-11MhSctpAgent+0x90): undefined reference to ‘sctpAgent:: ProcessSackChunks(unsigned char*, Boolean_E)’ sctp/mhsctp.o: (gnu.linkonce.d__vt-11MhSctpAgent+0x90): undefined reference to ‘sctpAgent:: ProcessOptionChunks(unsigned char*, Boolean_E)’ sctp/mhsctp.o: (gnu.linkonce.d__vt-11MhSctpAgent+0x90): undefined reference to ‘sctpAgent:: ProcessChunks(unsigned char*, unsigned char**)’ sctp/mhsctp.o: In function ‘AppData type_info function’: mhsctp.cc: (gnu.linkonce.t__tfAppData+0x1a): undefined reference to ‘__rtti_user’ sctp/mhsctp.o: In function ‘AppData::~AppData (void)’:type_info function’: mhsctp.cc: (gnu.linkonce.t__7AppData+0x1a): undefined reference to ‘__builtin_delete’ sctp/mhsctp.o: In function ‘PacketData type_info function’: mhsctp.cc: (gnu.linkonce.t__tf10PacketData+0x26): undefined reference to ‘__rtti_si’ sctp/mhsctp.o: In function ‘PacketData::~PacketData(void)’: mhsctp.cc: (gnu.linkonce.t_._10PacketData+0x1e): undefined reference to ‘__builtin_vec_delete’ sctp/mhsctp.o: In function ‘PacketData::copy(void)’: Mhsctp.cc: (PacketData::gnu.linkonce.t.copy(void)+0xe): undefined reference to ‘__builtin_new’ Sctp/mhsctp.o: In function ‘MhSctpClass::create(int, char const *const *)’: Mhstcp.cc(.MhSctpClass::gnu.linkonce.t.create(int, char const *const *)+0xd:undefined reference to ‘__bultin_new’ Sctp/mhreg.o: In function ‘MhBSAgent::MhBSAgent(void)’: mreg.cc(.text+0xe): undefined reference to ‘Agent::Agent(packet_t)’ mreg.cc(.text+0x97): undefined reference to ‘TclObject::bind(char const”, int*)’ mreg.cc(.text+0c3): undefined reference to ‘Agent::~Agent(void)’ mreg.cc(.text+0d0): undefined reference to ‘__rethrow’ mreg.cc(.text+0d5): undefined reference to ‘terminate(void)’ stp/mhreg.o: In function ‘MhBSAgent::recv(Packet*, Handler*)’: mreg.cc(.text+109): undefined reference to ‘hdr_ip::offset_’ mreg.cc(.text+121): undefined reference to ‘Address::instance_’ mreg.cc(.text+140): undefined reference to ‘Address::get_nodeaddr(int)’ mreg.cc(.text+145): undefined reference to ‘Address::instance_’ . . . . . .
and so many more. Maybe hundreds of them. I dont understand why this happen. I am tired of correcting the errors!..

And one more thing is that during compilation, some of the files that have been declared in the Makefile.in have been deleted ( I don’t know why), and thus an error will be given, for instance as shown below:

Make: *** Cannot make the target rule of “sctp/sctp.o” needed by “sctp/sctp.cc” Stop.

I have checked in the /sctp and it was not there, so I have copied back the sctp.o file, then after recompile, and it keep complaining the same (because it is again deleted).
Even though one of the errors has been corrected, more errors will be generated after re-compile. I wonder why this happened and could not think else what is the solution.

does anybody have a clue why this is happen? Thanks in advance.
  #2  
Old 11-Mar-2007, 09:03
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,641
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: gnu.linkonce undefined reference


Quote:
Originally Posted by newbie06
I am using ns2 as my simulator

but I think this problem is related with c++.
I am facing a problem during compilation process in which I got several pages of errors. Some of them are listed below (I cannot paste all here because it is too long, howver, the errors are quite the same, complaining about the .gnu.linkonce and undefine reference):
.
.
.

Make: *** Cannot make the target rule of “sctp/sctp.o” needed by “sctp/sctp.cc” Stop.
.
.
.
Sctp/mhsctp.o: In function ‘MhSctpClass::create(int, char const *const *)’:
Mhstcp.cc(.MhSctpClass::gnu.linkonce.t.create(int, char const *const *)+0xd:undefined reference to ‘__bultin_new’
.
.
.
Sctp/mhreg.o: In function ‘MhBSAgent::MhBSAgent(void)’:
mreg.cc(.text+0xe): undefined reference to ‘Agent::Agent(packet_t)’



I have checked in the /sctp and it was not there, so I have copied back the sctp.o file, then after recompile, and it keep complaining the same (because it is again deleted).

I am assuming that your original installation was successful and now you are compiling with some new code that you have added. If not, then tell us exactly what you have done up to this point.


If you have added some new stuff, exactly what did you change in the ns directories to get the new stuff there? Did you copy the entire ns installation tree somewhere else or are you doing your new stuff on top of the old stuff? (Either can be made to work, I think, but I usually create a new tree identical to the old one before making changes. That way I can always go back to the old one for testing.)

Did you do a "make clean" before "make" or what? In other words, how did you try to build the new stuff. (I recommend "make clean" at the top ns-... directory

What Linux distribution are you using?

At a Linux command line, what do you get when you enter "g++ --version". Some older versions of GNU compilers had problems with "#pragma installation" and gave the mysterious "linkonce" messages. (version 3.4.x or higher should be OK.)

How much code is in your new files? Can you post them?

When you do a "make", it needs to find the source files "something.cc" or "something.h" to create new files (the "something.o") stuff. Are all of your source files in place? Copying the "something.o" stuff is not the thing to do. Copy the ".cc" and ".h" files to the corresponding places in the new directories. (I just copy everything, then do "make clean".)

I can't reproduce your problems or give any specific help, since my installation is for the current version (ns-2.30), and it does not have mhsctp.cc. My directory name for the sctp stuff is "sctp" not "Sctp". It does not have mhsctp.cc or Mhsctp.cc or mhreg.cc

Regards,

Dave
  #3  
Old 13-Mar-2007, 05:43
newbie06 newbie06 is offline
New Member
 
Join Date: Oct 2006
Posts: 21
newbie06 is on a distinguished road

Re: gnu.linkonce undefined reference


Hi Dave,


Quote:
I am assuming that your original installation was successful and now you are compiling with some new code that you have added.

Yes u're right. After finished compiling the original installation, I added my codes on top of the original tree, and some of the original files have been replace with the new one such as Makefile.in, ns-default.tcl, ns-lib.tcl and many more, and the old file have been renamed to a new filename.

Quote:
Did you do a "make clean" before "make" or what? In other words, how did you try to build the new stuff. (I recommend "make clean" at the top ns-... directory
yes, I did 'make clean' after ./configure. After that only I do 'make'. All of the 3 commands were executed at ns-allinone-2.26/ns-2.26/


Quote:
What Linux distribution are you using?

I am using Knoppix. Is it can contribute to the errors?

Quote:
At a Linux command line, what do you get when you enter "g++ --version".

This is what I got when i typed the above command:

Code:
g++ (GCC) 3.3.6 (Debian 1.3.3.6-7) Copyright (c) 2003.............not even for MERCHANTABILITY/FITNESS FOR A PARTICULAR PURPOSES
..

U said version 3.4.x or higher should be ok..Is that means that my compiler is not compatible?


Quote:
How much code is in your new files? Can you post them?

ohh...there are so many files that I could not post it here. So many folders and inside one folders there are so many script files.


Quote:
When you do a "make", it needs to find the source files "something.cc" or "something.h" to create new files (the "something.o") stuff. Are all of your source files in place? Copying the "something.o" stuff is not the thing to do. Copy the ".cc" and ".h" files to the corresponding places in the new directories. (I just copy everything, then do "make clean".)

yeah..! U are right, I have misunderstood about this. I thought that the 'something.o' file is the file that we create. Thanks for make me clear.



Dave, after all, I have managed to solve all the problem above. I dont know, after I reboot into windows, and reboot back into linux, I recompiled again and all the errors dissappear, just as nothing happened before..so wierd!..It still got errors, but the small errors like undefined variables etc that I managed to solve. So could you please explain why this happened? It maybe happen again in future, so I need to know why..

ok, howevere, there are something wrong with the compilation result, as follows:

Code:
make[1]: Entering directory '/home/my/sproject/ns-allinone-2.26/ns-2.26/indep-utils/webtrace-conv/ucb' make[1]: Nothing to be done for 'all' make[1]: Leaving directory 'home/my/sproject/ns-allinone-2.26/ns-2.26/indep-utils/webtrace-conv/ucb' my@box-ns2:~/sproject/ns-allinone-2.26/ns-2.26$ns ns: [code omitted because of length] :invalid command name "Node/MobileNode/MhSatNode" while executing "Node/MobileNode/MhSatNode instproc init args { $self instvar id_ agents_ dmux_ address_ address1_ nodetype_ if {[llength $args] == 2} { set address..."


Do you know what is the problem?
many thanks...

Ok..thanks in advance for your help..
  #4  
Old 13-Mar-2007, 08:58
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,641
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: gnu.linkonce undefined reference


Quote:
Originally Posted by newbie06
I am using Knoppix. Is it can contribute to the errors?
I doubt it, but sometimes it might make a difference if we are using different distributions.
Quote:
Originally Posted by newbie06


This is what I got when i typed the above command:

Code:
g++ (GCC) 3.3.6 (Debian 1.3.3.6-7) Copyright (c) 2003.............not even for MERCHANTABILITY/FITNESS FOR A PARTICULAR PURPOSES
..

U said version 3.4.x or higher should be ok..Is that means that my compiler is not compatible?
I don't know what versions were afflicted, but I think they might have been older than 3.3. Furthermore, the error only occurred under certain circumstances, and I don't know what the cause or the resolution was.

Quote:
Originally Posted by newbie06
ohh...there are so many files that I could not post it here. So many folders and inside one folders there are so many script files.
I thought so. It probably wouldn't do much good to post them, since other people would have a very hard time following them anyhow. You are probably already beyond my personal ability to help. (But keep asking --- there may be others who can help.)

Quote:
Originally Posted by newbie06
yeah..! U are right, I have misunderstood about this. I thought that the 'something.o' file is the file that we create.
It takes a little "getting used to".
Quote:
Originally Posted by newbie06


Dave, after all, I have managed to solve all the problem above. I dont know, after I reboot into windows, and reboot back into linux, I recompiled again and all the errors dissappear, just as nothing happened before..so wierd!..It still got errors, but the small errors like undefined variables etc that I managed to solve. So could you please explain why this happened? It maybe happen again in future, so I need to know why..
I don't have any clues. However, in my experience, things that fix themselves now might 'un-fix' themselves later. Whether it was "cockpit error" or some vague, unpredictable "feature" of the tools. So, I understand your need to know; I just don't know how to get to the bottom of things from long distance.
Quote:
Originally Posted by newbie06

ok, howevere, there are something wrong with the compilation result, as follows:

Do you know what is the problem?
Can't tell from here. Sorry.

Regards,

Dave
  #5  
Old 13-Mar-2007, 09:53
newbie06 newbie06 is offline
New Member
 
Join Date: Oct 2006
Posts: 21
newbie06 is on a distinguished road

Re: gnu.linkonce undefined reference


Quote:
You are probably already beyond my personal ability to help. (But keep asking --- there may be others who can help.)


No Dave, I am still a 'newbie'..still have alot to learn..anyway thanks for all the answers..;-)
 
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
linker error unpep FLTK Forum 4 15-Apr-2007 03:03
about undefined reference for 'sinf' bharat suthar C Programming Language 4 12-May-2006 19:37
c++ inheritance illbemissingu CPP / C++ Forum 14 23-Oct-2005 17:35
Linker Errors with Dev-C++ 5 Gamer_2k4 CPP / C++ Forum 1 18-Apr-2005 11:08
fltk-2.0 cvs Plumb FLTK Forum 20 13-Nov-2004 07:10

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 11:33.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.