Error C2079 Msdn
Contents |
Windows Desktop Development > C++ Standards, Extensions, and Interop Question 0 Sign in to vote Good Morning all, I encountered a compiler error c2079 which said "use of undefined error c2079 uses undefined class class/struc/union name" and am not sure how to solve it. The following is error c2079 uses undefined struct a simplifiedsetup of classes inside my code: class a; class b { int b1; public : func1(); } b::func1() { a c++ template uses undefined class aclass; aclass.a1() <== this is where error c2079 come from. a1 is a public function of class a } I search Microsoft C++ compiler error web. It suggests that using pointer to a,
C++ Undefined Class
instead of instance of a. So I changed a aclass to a * aclass = NULL; and aclass.a1() to aclass->a1(); The compiler error changed to c2027 : use of undefined type 'a' Any suggestions? Thanks for your help. Tom Lin Thursday, May 06, 2010 4:09 PM Reply | Quote Answers 0 Sign in to vote I would suggest to split class interface (to be put in .h class type redefinition c++ files) from class implementation (to be put in .cpp file). So, you should have 4 files: ClassA.h (header containing interface of class A) ClassA.cpp (implementation of class A) ClassB.h (header containing interface of class B) ClassB.cpp (implementation of class B) The implementation of B::func1 method should be put in ClassB.cpp file. The implementation of A::a1 method should be put in ClassA.cpp file. At the beginning of ClassB.cpp file, you should add a #include "ClassA.h" because you are using class A. See if this helps... Giovanni Marked as answer by Tom C. Lin Thursday, May 06, 2010 6:41 PM Thursday, May 06, 2010 4:44 PM Reply | Quote All replies 0 Sign in to vote I would suggest to split class interface (to be put in .h files) from class implementation (to be put in .cpp file). So, you should have 4 files: ClassA.h (header containing interface of class A) ClassA.cpp (implementation of class A) ClassB.h (header containing interface of class B) ClassB.cpp (implementation of class B) The implementation of B::func1 method should be put in ClassB.cpp file. The implementation of A::a1 method should be put in ClassA.cpp file. At the beginning of Cla
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups c2039 TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs
Error C2664
and reference Dev centers Retired content Samples We’re sorry. The content you requested has been
C++ Forward Declaration
removed. You’ll be auto redirected in 1 second. C/C++ Building Reference C/C++ Build Errors Compiler Errors C2001 through C2099 Compiler Errors C2001 through C2099 Compiler https://social.msdn.microsoft.com/Forums/vstudio/en-US/1654902a-a022-4885-93d6-23ab6709b635/how-to-fix-compiler-error-c2079?forum=vclanguage Error C2039 Compiler Error C2039 Compiler Error C2039 Compiler Error C2001 Compiler Error C2002 Compiler Error C2003 Compiler Error C2004 Compiler Error C2005 Compiler Error C2006 Compiler Error C2007 Compiler Error C2008 Compiler Error C2009 Compiler Error C2010 Compiler Error C2011 Compiler Error C2012 Compiler Error C2013 Compiler Error C2014 Compiler https://msdn.microsoft.com/en-us/library/fdwb3fd7.aspx Error C2015 Compiler Error C2017 Compiler Error C2018 Compiler Error C2019 Compiler Error C2020 Compiler Error C2021 Compiler Error C2022 Compiler Error C2026 Compiler Error C2027 Compiler Error C2028 Compiler Error C2030 Compiler Error C2032 Compiler Error C2033 Compiler Error C2034 Compiler Error C2036 Compiler Error C2039 Compiler Error C2040 Compiler Error C2041 Compiler Error C2042 Compiler Error C2043 Compiler Error C2044 Compiler Error C2045 Compiler Error C2046 Compiler Error C2047 Compiler Error C2048 Compiler Error C2050 Compiler Error C2051 Compiler Error C2052 Compiler Error C2053 Compiler Error C2054 Compiler Error C2055 Compiler Error C2056 Compiler Error C2057 Compiler Error C2058 Compiler Error C2059 Compiler Error C2060 Compiler Error C2061 Compiler Error C2062 Compiler Error C2063 Compiler Error C2064 Compiler Error C2065 Compiler Error C2066 Compiler Error C2067 Compiler Error C2069 Compiler Error C2070 Compiler Error C2071 Compiler Error C2072 Compiler Error C2073 Compiler Error C2074 Compiler Error C
(87) 목록보기| 요약보기| 펼쳐보기 0DVIs Caps Lock 화면 알림 끄기 B0401 Caps Lock 화면 알림 끄기 http://blog.daum.net/_blog/BlogTypeView.do?blogid=0DVIs&articleno=147 | Windows Dark 2015.12.23 06:05 http://blog.daum.net/darkprisoner/168 Caps Lock 화면 알림 끄기, 특수 키 입력 알림 끄기 댓글 0 | 엮인글 0 카페로 스크랩 블로그로 http://forums.codeguru.com/showthread.php?209136-error-C2079-and-error-C2224 스크랩 메일로 스크랩 즐겨찾기 인쇄 신고 이 글을... (0) 엮인글 주소 : http://blog.daum.net/darkprisoner/tb/168 내용 텍스티콘 ▲ top 12345678910...87 다음 ▶ 목록보기 'Windows' 카테고리의 다른 error c2079 글 2015-12-23 06:05:51 Caps Lock 화면 알림 끄기 2014-06-16 21:43:40 [Windows]원격 접속 시 접속 수 초과 메세지 2014-02-20 10:40:42 [Windows] 좀비프로세스 2013-06-18 20:03:17 [Windows] 인터넷 시간 서버 포트 2013-05-08 21:27:20 [Windows] 원격데스크탑 포트 변경 Dark 블로그 소개About blog▶ 친구신청 즐겨찾기 카테고리Category 전체보기 (87) 비공개 ▼▲ FaceBook (12) 글 error c2079 uses ▼▲ 잡담 (1) OS ▼▲ Linux (0) Windows (10) 개발 ▼▲ C++ (20) Winapi (7) MFC (3) Visual Studio (9) DataBase ▼▲ MsSQL (10) MySQL (0) Oracle (0) 공부 ▼▲ 지식 (12) UI/UX (0) DirectX (1) 즐겨찾기Bookmark 즐겨찾기가 없습니다. 최근 글들Recent post •Caps Lock 화면 알.. Caps Lock 화면 알.. | 2015-12-23 06:05:51 블루투스용 소프트웨어에서 알림이 뜨는 것이었다고 한다 해결방법은 레지스트리 수정 1. [윈도우 키 + R] 하여 실행모드를 띄움 2. regedit 입력 후 실행 3. HKEY_LOCAL_MACHINE > SOFTWARE > Widcomm > BTConfig > General 경로의 KeyIndication 값을 0 으로 변경 4. Reboot~ 출처 : http://answers.microsoft.com/en-us/wi.. •visual studio un.. visual studio un.. | 2015-09-01 21:58:58 visual studio 2013 express 설치 후 사용하다가 삭제하려는데... 제어판에 관련 목록 없음 시작 메뉴의 프로그램 폴더에
Forum Visual C++ & C++ Programming Visual C++ Programming error C2079 and error C2224 If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 4 of 4 Thread: error C2079 and error C2224 Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode September 11th, 2002,03:04 AM #1 kea View Profile View Forum Posts Member Join Date Sep 2002 Posts 27 error C2079 and error C2224 error C2079: 'reg' uses undefined union 'REGS' error C2224: left of '.h' must have struct/union type Error executing cl.exe. FILTER.exe - 9 error(s), 1 warning(s) Can anyone help to solve this problem? Thank you. Reply With Quote September 11th, 2002,03:33 AM #2 Fulcanel0 View Profile View Forum Posts Junior Member Join Date Sep 2002 Posts 6 From MSDN : -- Compiler Error C2079 'identifier' uses undefined class/struct/union 'name' The specified identifier was declared as a class, structure, or union that was not defined. This error can be caused by initializing an anonymous union. -- Compiler Error C2224 left of '.identifier' must have class/struct/union type The left operand of the member-of operator (.) is not a class, structure, or union type. This error can occur when the left operand is an undefined variable. Undefined variables have type int. -- You should post your code if you want more ... Reply With Quote September 11th, 2002,06:10 AM #3 y_s Guest Hi I suppose you'd like to work with the registers for some reason In case I'm right you should include the stdio.h or dos.h header file where you use the structure. e.g. Code: #include