472,336 Members | 1,212 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,336 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 1866
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...
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...
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...
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...
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...
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...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.