ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
please I have some errors on this that I am having issues to solve.
thanks for the time
errors shown are
Code:
/drop-tail.h:63:48: error: ISO C++ forbids declaration of ‘override’ with no type [-fpermissive]
/drop-tail.h:66:51: error: ISO C++ forbids declaration of ‘override’ with no type [-fpermissive]
/drop-tail.h:66:41: error: ‘const int DropTail::override()’ cannot be overloaded
/drop-tail.h:63:38: error: with ‘const int DropTail::override()’
Code:
/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
/*
*
* @(#) $Header: /cvsroot/nsnam/ns-2/queue/drop-tail.h,v 1.19 2004/10/28 23:35:37 haldar Exp $ (LBL)
*/
#ifndef ns_drop_tail_h
#define ns_drop_tail_h
#include <string.h>
#include "queue.h"
#include "config.h"
#include <float.h>
/*
* A bounded, drop-tail queue
*/
class DropTail : public Queue {
public:
DropTail() {
q_ = new PacketQueue;
pq_ = q_;
bind_bool("drop_front_", &drop_front_);
bind_bool("summarystats_", &summarystats);
bind_bool("queue_in_bytes_", &qib_); // boolean: q in bytes?
bind("mean_pktsize_", &mean_pktsize_);
// _RENAMED("drop-front_", "drop_front_");
}
~DropTail() {
delete q_;
}
virtual bool empty() ; const override ();
// johna 07 06 2013 virtual bool empty() ;const override;
// johna 07 06 2013 virtual double get_hol() const override { return (empt
virtual double get_hol(); const override () { return (empty()) ? DBL_MAX : hdr_cmn::access(q_->head())->timestamp(); }
protected:
void reset();
int command(int argc, const char*const* argv);
void enque(Packet*);
Packet* deque();
void shrink_queue(); // To shrink queue and drop excessive packets.
PacketQueue *q_; /* underlying FIFO queue */
int drop_front_; /* drop-from-front (rather than from tail) */
int summarystats;
void print_summarystats();
int qib_; /* bool: queue measured in bytes? */
int mean_pktsize_; /* configured mean packet size in bytes */
};
#endif
Did you write this code or download it from somewhere or what?
This line of code is incorrect:
Code:
virtual bool empty() ; const override ();
But I don't have a guess of what whoever wrote that actually intended.
Edit: I think probably the intended code is:
Code:
virtual bool empty() const override;
and similar change for the other place where you have the same mistake.
But that seems like that would be changing the code back to the way it was before, which brings up the question: why did you break it to begin with?
If something was wrong before, that you tried to correct with that misguided change, it would have been better to post the earlier version and the original problem, rather than obscure things by adding a new error.
@johnsfine @knudfl, thanks all for the reply and concern.
yes I downloaded it for that site after I have had a working ns 2.35 and I have done some other project ont it. Then I needed a poisson distribution (poisson.cc etc) source but it is not native to ns 2.35. I tried to use the one here since it has some poisson links charactersitics. It seems it an updated version by that user but when I was building it, there exists those errors that I gave earlier but in another form of
Quote:
there is a need for ; and virtual is empty etc
in
Quote:
virtual bool empty() const override;
so I did comment off some of them but again there was this error that I gave ealier on the 1st post.
thanks for the time once agin that was so kind. I have read how I could merge two ns2 version on Ubuntu but they are the same ns2.35 only general one and one thone by a user. If you have more suggestions or what I need to do on it, I will really appreciate it.
so to be precise @johnsfine, I changed it because when building it gave error with
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 4 .
No reason to add the file to ns-2.35, if it will fit better in another version :
You can have as many versions of ns-allinone as you want,
installed at the same time. But do not add any path text to .bashrc.
No reason to add the file to ns-2.35, if it will fit better in another version :
You can have as many versions of ns-allinone as you want,
installed at the same time. But do not add any path text to .bashrc.
I'm unclear on what is a "version" in this context. I would have thought 2.35 was a "version".
But the OP is mixing two different sets of source code, both of which seem to say they are "ns-2.35".
A lot of those differences (maybe all) are edits made in the second one by anirudhSK, including adding the code in drop-tail.h that the OP is having trouble with.
I assume the OP has used some drop-tail.h (and maybe other files) from that second ns2.35 together with files from the first ns2.35 and that doesn't work.
Those changes (by anirudhSK) are multi file changes. For example, the changes in drop-tail.h are tightly coupled with the changes in queue.h
I used it because it contains poisson traffic characteristics.
I don't understand what/why you wanted to get from each of these two sources. If you want something only one of them has, why not use entirely that one?
thanks all. I found my way round it and used an old version of Poisson.cc file on the Internet to create the poisson traffic in the network I was working on. So I did not use this again. But thanks so much for your time and kindness.
all
Quote:
@johnsfine But to answer some of the questions raised, I tried to check all the ns2.35 edited version to see if I could use them. thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.