![]() |
|
#1
|
|||
|
|||
gnu.linkonce undefined referenceHi 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:
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
|
|||
|
|||
Re: gnu.linkonce undefined referenceQuote:
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
|
||||||
|
||||||
Re: gnu.linkonce undefined referenceHi Dave,
Quote:
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:
Quote:
I am using Knoppix. Is it can contribute to the errors? Quote:
This is what I got when i typed the above command: Code:
U said version 3.4.x or higher should be ok..Is that means that my compiler is not compatible? Quote:
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:
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:
Do you know what is the problem? many thanks... Ok..thanks in advance for your help.. |
|
#4
|
||||||
|
||||||
Re: gnu.linkonce undefined referenceQuote:
Quote:
Quote:
Quote:
Quote:
Quote:
Regards, Dave |
|
#5
|
|||
|
|||
Re: gnu.linkonce undefined referenceQuote:
No Dave, I am still a 'newbie'..still have alot to learn..anyway thanks for all the answers..;-) |
Recent GIDBlog
Toyota - 2008 July Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
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