473,748 Members | 2,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compile error with virtual inheritance: const <anonymous>** - AGAIN

Hi!

First - thanks for your previous replies! After fixing the c'tor
everything went fine until ... I added one more class in the hierachie.

I have a class hierachie like this:

// interface, abstract only
class ISession {

}

// implements common parts of ISession
class Session: public virtual ISession {
public:
Session(Socket* conn);

}

// implements the rest of ISession
class P2PSession: public virtual Session {
public:
P2PSession(Sock et* conn);
}

and I added one more class:

class P2PClient: public virtual P2PSession
{
public:
P2PClient(Socke t* conn);
}

I get this error on compile:

g++ -c -g -Wall -O2 -I./include -o src/P2PClient.o src/P2PClient.cpp
src/P2PClient.cpp: In constructor `
FTPServer_::P2P Client::P2PClie nt(FTPServer_:: Socket*)':
src/P2PClient.cpp:1 0: error: no matching function for call to `
FTPServer_::Ses sion::Session(c onst <anonymous>** )'
include/Session.h:10: error: candidates are:
FTPServer_::Ses sion::Session(c onst
FTPServer_::Ses sion&)
include/Session.h:12: error:
FTPServer_::Ses sion::Session(F TPServer_::Sock et*)
make: *** [src/P2PClient.o] Fehler 1

The c'tor of P2PSession:

//----------------------------------------------------------------------
P2PSession::P2P Session(Socket* conn) : Session(conn)
{
}

The c'tor of P2PClient:
//----------------------------------------------------------------------
P2PClient::P2PC lient(Socket* conn): P2PSession(conn ),
state_(CS_INIT_ NEEDED)
{
}

Any ideas?

TIA,
--
----------------------------------------------------------------
,yours Thomas Zangl - th****@tzis.net - http://www.tzis.net/ -
- Freelancer - IT Consulting & Software Development -
Use Y.A.M.C! now! Get it at http://www.borg-kindberg.ac.at/yamc/
Jan 14 '06 #1
2 1942
Thomas Zangl wrote:

Hi!
// implements the rest of ISession
class P2PSession: public virtual Session {
public:
P2PSession(Sock et* conn);
}


Fixed it by removing "virtual" in the inhertiance of P2PSession from
Session.

I now tried to inherit P2PClient from the interface "INFSObserv er" but
the linker gives me an error:

src/P2PClient.o(.te xt+0xed): In function
`FTPServer_::P2 PClient::~P2PCl ient [in-charge]()':
include/INFSObserver.h: 12: undefined reference to `vtable for
FTPServer_::INF SObserver'
src/P2PClient.o(.te xt+0x13d): In function
`FTPServer_::P2 PClient::~P2PCl ient [in-charge deleting]()':
include/INFSObserver.h: 12: undefined reference to `vtable for
FTPServer_::INF SObserver'
src/P2PClient.o(.gn u.linkonce.r._Z TIN10FTPServer_ 9P2PClientE+0x1 8):include/ISession.h:28:
undefined reference to `typeinfo for FTPServer_::INF SObserver'
collect2: ld returned 1 exit status
make: *** [ftpserver] Fehler 1
INFSObserver.h is included in P2PClient.h

The inheritance looks like this now:

class P2PClient: public virtual P2PSession, public virtual INFSObserver
{
public:
......
}

Any ideas?

TIA :-)
--
----------------------------------------------------------------
,yours Thomas Zangl - th****@tzis.net - http://www.tzis.net/ -
- Freelancer - IT Consulting & Software Development -
Use Y.A.M.C! now! Get it at http://www.borg-kindberg.ac.at/yamc/
Jan 14 '06 #2
Thomas Zangl wrote:

Hi,
// implements the rest of ISession
class P2PSession: public virtual Session {
public:
P2PSession(Sock et* conn);
}


removed the "virtual" inheritance and everything works fine now!

Best regards,
--
----------------------------------------------------------------
,yours Thomas Zangl - th****@tzis.net - http://www.tzis.net/ -
- Freelancer - IT Consulting & Software Development -
Use Y.A.M.C! now! Get it at http://www.borg-kindberg.ac.at/yamc/
Jan 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
9424
by: JR | last post by:
Hi, I'm migrating my website to an IIS 6.0 server and all the asp pages work fine except for the ones that reference include files, even though I have "Enable parent paths" enabled in the App/Options tab. The include files are being called as <!-- #include virtual="../includes/file.inc" --> <!-- #include virtual="../includes/script.asp" --> If I remove the parent path call it works just fine. I
8
5052
by: Christian Stigen Larsen | last post by:
Consider the following: class parent { public: virtual void print() { printf("Parent\n"); } }; class child : public parent {
3
2476
by: H. S. | last post by:
Hi, I am trying to compile these set of C++ files and trying out class inheritence and function pointers. Can anybody shed some light why my compiler is not compiling them and where I am going wrong? I am using g++ (GCC) 3.3.5 on a Debian Sarge system. The compiler complains: //**************************** //**************************** Compiler output starts *********** cd /home/red/tmp/testprogs/
8
6683
by: Matt | last post by:
I am migrating from NT 4.0 (IIS 4) to 2003 Server (IIS 6). Our Intranet has numerous applications that utilize the FileSystemObject (FSO) and each one is returning a "Path not found." error. These applications work fine on IIS 4. Here is the scenario: - Mapped Drives on server to anotheer network Drive (I.E. - Q:\) - IIS uses different Domain accounts for anonymous access (based on the application). - These domain accounts have all of...
2
1288
by: Andrew | last post by:
I'm getting this error again. I received it once before because of an XP Pro bug: I ran the batch file which patched the ASP user (perhaps some of you know the one) I'm not sure why it's recurring now. Can someone point me to a definitive list for sources of this error. It seems as though it can be caused by many things. The application event log shows the standard...
2
2952
by: Jon | last post by:
Has anyone ever come across this error? When working on Web Applications I get the following when compliling. When I reboot my pc and compile a basic ASPX I am ok for about 30 min. After that time frame if I try to compile again I get the Compile Error. Why would it work one minute and not the next. I can create a new Web Application(VB or C#) and add a button (no functionality) to the page and everything is fine for about 30 min.,...
1
2023
by: Scott Vercuski | last post by:
Everyone, I'm lost as to why I'm getting the following Error message on my ..NET application. Here's the error message I'm getting: ------------------------------------------------------------------------------- Access to the path <path> is denied. Description: An unhandled exception occurred during the execution of
11
1927
by: Thomas Zangl | last post by:
Hi! I have a class hierachie like this: // interface, abstract only class ISession { } // implements common parts of ISession
36
5103
by: Roedy Green | last post by:
The only browser I have encountered that supports <colgroup><col class="behold"></colgroup> to apply a CSS style to a whole column, is Microsoft Internet Explorer. I have been told it SHOULD NOT do so, since this is not part of the specification. How then to you apply styles to entire columns? Surely you don't have to write <td class="behold"on every row item.
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.