473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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(Socket* conn);
}

and I added one more class:

class P2PClient: public virtual P2PSession
{
public:
P2PClient(Socket* 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_::P2PClient::P2PClient(FTPServer_::Socke t*)':
src/P2PClient.cpp:10: error: no matching function for call to `
FTPServer_::Session::Session(const <anonymous>**)'
include/Session.h:10: error: candidates are:
FTPServer_::Session::Session(const
FTPServer_::Session&)
include/Session.h:12: error:
FTPServer_::Session::Session(FTPServer_::Socket*)
make: *** [src/P2PClient.o] Fehler 1

The c'tor of P2PSession:

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

The c'tor of P2PClient:
//----------------------------------------------------------------------
P2PClient::P2PClient(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 1924
Thomas Zangl wrote:

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


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

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

src/P2PClient.o(.text+0xed): In function
`FTPServer_::P2PClient::~P2PClient [in-charge]()':
include/INFSObserver.h:12: undefined reference to `vtable for
FTPServer_::INFSObserver'
src/P2PClient.o(.text+0x13d): In function
`FTPServer_::P2PClient::~P2PClient [in-charge deleting]()':
include/INFSObserver.h:12: undefined reference to `vtable for
FTPServer_::INFSObserver'
src/P2PClient.o(.gnu.linkonce.r._ZTIN10FTPServer_9P2PC lientE+0x18):include/ISession.h:28:
undefined reference to `typeinfo for FTPServer_::INFSObserver'
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(Socket* 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
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...
8
by: Christian Stigen Larsen | last post by:
Consider the following: class parent { public: virtual void print() { printf("Parent\n"); } }; class child : public parent {
3
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...
8
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...
2
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...
2
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...
1
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: ...
11
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.