Happy Children's day to All! I met a problem. I can't use the derived Class from CSocket in Another Class.
-
I derived a new class named CMySocket from CSocket. Then generate another class named CCollectorInfo (in order to store the information of Collector),I defined a CMySocket pointer in this class. Already included the header file of CMySocket I got error messages as follow: --------------------Configuration: SaroTransfer - Win32 Debug-------------------- Compiling... MySocket.cpp c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2143: syntax error : missing ';' before '*' c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'CMySocket' : missing storage-class or type specifiers c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'pSocket' : missing storage-class or type specifiers Error executing cl.exe. SaroTransfer.exe - 3 error(s), 0 warning(s) Thanks of any help!
-
I derived a new class named CMySocket from CSocket. Then generate another class named CCollectorInfo (in order to store the information of Collector),I defined a CMySocket pointer in this class. Already included the header file of CMySocket I got error messages as follow: --------------------Configuration: SaroTransfer - Win32 Debug-------------------- Compiling... MySocket.cpp c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2143: syntax error : missing ';' before '*' c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'CMySocket' : missing storage-class or type specifiers c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'pSocket' : missing storage-class or type specifiers Error executing cl.exe. SaroTransfer.exe - 3 error(s), 0 warning(s) Thanks of any help!
You are missing a semicolon. It could be in MySocket.cpp before line 22, or it could be in one of the header files that you included in MySocket.cpp
[
](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!
-
I derived a new class named CMySocket from CSocket. Then generate another class named CCollectorInfo (in order to store the information of Collector),I defined a CMySocket pointer in this class. Already included the header file of CMySocket I got error messages as follow: --------------------Configuration: SaroTransfer - Win32 Debug-------------------- Compiling... MySocket.cpp c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2143: syntax error : missing ';' before '*' c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'CMySocket' : missing storage-class or type specifiers c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'pSocket' : missing storage-class or type specifiers Error executing cl.exe. SaroTransfer.exe - 3 error(s), 0 warning(s) Thanks of any help!
Sounds like the compiler doesn't recognize
CMySocket
. If you included MySocket.h inside collectorinfo.h, then announce the class in collectorinfo.h by typingclass CMySocket
before any declarations. Or inlcude the header inside collectorinfo.h.
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
-
Sounds like the compiler doesn't recognize
CMySocket
. If you included MySocket.h inside collectorinfo.h, then announce the class in collectorinfo.h by typingclass CMySocket
before any declarations. Or inlcude the header inside collectorinfo.h.
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
-
ocean2000 wrote: Erverthing is ok today! I don't know why ... better than the other way around ;)
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve