Thread: Problem with Visual C++ Object-Oriented Programming Book.

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    22

    Question Problem with Visual C++ Object-Oriented Programming Book.

    I have a book for c++ programming called Visual C++ Object-Oriented Programming, it makes a program thru the book called ZALTAR. When i try and compile the program i get lots of linker errors and some other errors... Any ideal what the problem is??

    Thanks ~GameGenie

  2. #2
    Nonconformist Narf's Avatar
    Join Date
    Aug 2005
    Posts
    174
    It probably relies on a library that you didn't link with, but it's hard to tell without seeing any code.
    Just because I don't care doesn't mean I don't understand.

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    22

    Question

    The code is huge but i can show the errors...

    Code:
    Compiler: Default compiler
    Building Makefile: "C:\Dev-Cpp\Makefile.win"
    Executing  make...
    make.exe -f "C:\Dev-Cpp\Makefile.win" all
    g++.exe -c ../VCOOP/CH24/main.cpp -o ../VCOOP/CH24/main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"   
    
    g++.exe -c ../VCOOP/CH24/charlist.cpp -o ../VCOOP/CH24/charlist.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"   
    
    In file included from ../VCOOP/CH24/charlist.cpp:4:
    ../VCOOP/CH24/stdafx.h:6:58: afxwin.h: No such file or directory
    ../VCOOP/CH24/stdafx.h:7:55: afxext.h: No such file or directory
    In file included from ../VCOOP/CH24/charlist.cpp:5:
    ../VCOOP/CH24/zalthar.h:8:3: #error include 'stdafx.h' before including this file for PCH
    In file included from ../VCOOP/CH24/charlist.cpp:5:
    ../VCOOP/CH24/zalthar.h:19: error: expected class-name before '{' token
    ../VCOOP/CH24/zalthar.h:24: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthar.h:29: error: ISO C++ forbids declaration of `afx_msg' with no type
    ../VCOOP/CH24/zalthar.h:29: error: expected `;' before "void"
    
    ../VCOOP/CH24/zalthar.h:34: error: ISO C++ forbids declaration of `DECLARE_MESSAGE_MAP' with no type
    ../VCOOP/CH24/zalthar.h:34: error: expected `;' before '}' token
    ../VCOOP/CH24/zalthar.h:34: error: expected `;' before '}' token
    
    ../VCOOP/CH24/zalthar.h:39:21: warning: no newline at end of file
    In file included from ../VCOOP/CH24/charlist.h:7,
                     from ../VCOOP/CH24/charlist.cpp:6:
    ../VCOOP/CH24/zalthdoc.h:9:21: afxcoll.h: No such file or directory
    
    In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31,
                     from ../VCOOP/CH24/player.h:10,
                     from ../VCOOP/CH24/zalthdoc.h:10,
                     from ../VCOOP/CH24/charlist.h:7,
                     from ../VCOOP/CH24/charlist.cpp:6:
    C:/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
    In file included from ../VCOOP/CH24/zalthdoc.h:10,
                     from ../VCOOP/CH24/charlist.h:7,
                     from ../VCOOP/CH24/charlist.cpp:6:
    ../VCOOP/CH24/player.h:19: error: `CString' does not name a type
    ../VCOOP/CH24/player.h:24: error: `CString' does not name a type
    ../VCOOP/CH24/player.h:29: error: `CString' does not name a type
    ../VCOOP/CH24/player.h:33: error: expected class-name before '{' token
    
    ../VCOOP/CH24/player.h:35: error: `WORD' does not name a type
    ../VCOOP/CH24/player.h:36: error: `WORD' does not name a type
    ../VCOOP/CH24/player.h:37: error: `WORD' does not name a type
    ../VCOOP/CH24/player.h:38: error: `WORD' does not name a type
    ../VCOOP/CH24/player.h:39: error: `WORD' does not name a type
    ../VCOOP/CH24/player.h:40: error: `WORD' does not name a type
    ../VCOOP/CH24/player.h:41: error: `WORD' does not name a type
    ../VCOOP/CH24/player.h:42: error: `WORD' does not name a type
    ../VCOOP/CH24/player.h:43: error: field `m_classStr' has incomplete type
    ../VCOOP/CH24/player.h:44: error: field `m_raceStr' has incomplete type
    ../VCOOP/CH24/player.h:45: error: field `m_name' has incomplete type
    ../VCOOP/CH24/player.h:46: error: field `armor' has incomplete type
    ../VCOOP/CH24/player.h:47: error: field `weapon' has incomplete type
    ../VCOOP/CH24/player.h:48: error: field `magic' has incomplete type
    ../VCOOP/CH24/player.h:49: error: field `equipment' has incomplete type
    ../VCOOP/CH24/player.h:50: error: field `treasure' has incomplete type
    ../VCOOP/CH24/player.h:110: error: variable or field `Serialize' declared void
    ../VCOOP/CH24/player.h:110: error: `Serialize' declared as a `virtual' field
    
    ../VCOOP/CH24/player.h:110: error: expected `;' before '(' token
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetPlayerClass(int)':
    ../VCOOP/CH24/player.h:59: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:59: error: (Each undeclared identifier is reported only once for each function it appears in.)
    ../VCOOP/CH24/player.h:59: error: `m_class' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetPlayerRace(int)':
    ../VCOOP/CH24/player.h:60: error: `ASSERT_VALID' undeclared (first use this function)
    
    ../VCOOP/CH24/player.h:60: error: `m_race' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetClassStr(CString)':
    ../VCOOP/CH24/player.h:62: error: `aStr' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:62: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:62: error: `m_classStr' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetRaceStr(CString)':
    ../VCOOP/CH24/player.h:64: error: `aStr' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:64: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:64: error: `m_raceStr' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `int CCharacter::GetPlayerClass()':
    ../VCOOP/CH24/player.h:67: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:67: error: `m_class' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `int CCharacter::GetPlayerRace()':
    ../VCOOP/CH24/player.h:68: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:68: error: `m_race' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `CString CCharacter::GetRaceName()':
    ../VCOOP/CH24/player.h:69: error: return type `struct CString' is incomplete
    ../VCOOP/CH24/player.h:69: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:69: error: `m_raceStr' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `CString CCharacter::GetClassName()':
    ../VCOOP/CH24/player.h:70: error: return type `struct CString' is incomplete
    ../VCOOP/CH24/player.h:70: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:70: error: `m_classStr' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetName(CString)':
    ../VCOOP/CH24/player.h:71: error: `nm' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:71: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:71: error: `m_name' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `CString CCharacter::GetName()':
    ../VCOOP/CH24/player.h:72: error: return type `struct CString' is incomplete
    ../VCOOP/CH24/player.h:72: error: `m_name' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetWeapon(CString)':
    ../VCOOP/CH24/player.h:73: error: `wpn' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    
    ../VCOOP/CH24/player.h:73: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:73: error: `weapon' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `CString CCharacter::GetWeapon()':
    ../VCOOP/CH24/player.h:74: error: return type `struct CString' is incomplete
    ../VCOOP/CH24/player.h:74: error: `weapon' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetArmor(CString)':
    ../VCOOP/CH24/player.h:75: error: `arm' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    
    ../VCOOP/CH24/player.h:75: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:75: error: `armor' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `CString CCharacter::GetArmor()':
    ../VCOOP/CH24/player.h:76: error: return type `struct CString' is incomplete
    ../VCOOP/CH24/player.h:76: error: `armor' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetMagic(CString)':
    ../VCOOP/CH24/player.h:77: error: `mag' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:77: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:77: error: `magic' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `CString CCharacter::GetMagic()':
    ../VCOOP/CH24/player.h:78: error: return type `struct CString' is incomplete
    
    ../VCOOP/CH24/player.h:78: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:78: error: `magic' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetTreasure(CString)':
    ../VCOOP/CH24/player.h:79: error: `tr' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:79: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:79: error: `treasure' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `CString CCharacter::GetTreasure()':
    ../VCOOP/CH24/player.h:80: error: return type `struct CString' is incomplete
    ../VCOOP/CH24/player.h:80: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:80: error: `treasure' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetEquipment(CString)':
    ../VCOOP/CH24/player.h:81: error: `eq' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:81: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:81: error: `equipment' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `CString CCharacter::GetEquipment()':
    
    ../VCOOP/CH24/player.h:82: error: return type `struct CString' is incomplete
    ../VCOOP/CH24/player.h:82: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/player.h:82: error: `equipment' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetAbils(int, int, int, int, int, int)':
    
    ../VCOOP/CH24/player.h:86: error: `m_s' undeclared (first use this function)
    ../VCOOP/CH24/player.h:86: error: `m_d' undeclared (first use this function)
    ../VCOOP/CH24/player.h:86: error: `m_c' undeclared (first use this function)
    ../VCOOP/CH24/player.h:86: error: `m_i' undeclared (first use this function)
    ../VCOOP/CH24/player.h:87: error: `m_w' undeclared (first use this function)
    ../VCOOP/CH24/player.h:87: error: `m_ch' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::GetAbils(int*, int*, int*, int*, int*, int*)':
    ../VCOOP/CH24/player.h:91: error: `m_s' undeclared (first use this function)
    
    ../VCOOP/CH24/player.h:91: error: `m_d' undeclared (first use this function)
    ../VCOOP/CH24/player.h:91: error: `m_c' undeclared (first use this function)
    ../VCOOP/CH24/player.h:91: error: `m_i' undeclared (first use this function)
    ../VCOOP/CH24/player.h:92: error: `m_w' undeclared (first use this function)
    ../VCOOP/CH24/player.h:92: error: `m_ch' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `int CCharacter::GetStrength()':
    ../VCOOP/CH24/player.h:94: error: `m_s' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `int CCharacter::GetDexterity()':
    
    ../VCOOP/CH24/player.h:95: error: `m_d' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `int CCharacter::GetConstitution()':
    ../VCOOP/CH24/player.h:96: error: `m_c' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `int CCharacter::GetIntelligence()':
    ../VCOOP/CH24/player.h:97: error: `m_i' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `int CCharacter::GetWisdom()':
    ../VCOOP/CH24/player.h:98: error: `m_w' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `int CCharacter::GetCharisma()':
    ../VCOOP/CH24/player.h:99: error: `m_ch' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetStrength(int)':
    ../VCOOP/CH24/player.h:100: error: `m_s' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetDexterity(int)':
    ../VCOOP/CH24/player.h:101: error: `m_d' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetConstitution(int)':
    ../VCOOP/CH24/player.h:102: error: `m_c' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetIntelligence(int)':
    ../VCOOP/CH24/player.h:103: error: `m_i' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetWisdom(int)':
    ../VCOOP/CH24/player.h:104: error: `m_w' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In member function `void CCharacter::SetCharisma(int)':
    ../VCOOP/CH24/player.h:105: error: `m_ch' undeclared (first use this function)
    ../VCOOP/CH24/player.h: At global scope:
    ../VCOOP/CH24/player.h:118: error: ISO C++ forbids declaration of `DECLARE_SERIAL' with no type
    ../VCOOP/CH24/player.h:118: error: expected `;' before "protected"
    ../VCOOP/CH24/player.h:120: error: `BOOL' does not name a type
    ../VCOOP/CH24/player.h:130: error: variable or field `SetDirty' declared void
    ../VCOOP/CH24/player.h:130: error: expected `;' before '(' token
    ../VCOOP/CH24/player.h:134: error: expected `;' before "BOOL"
    ../VCOOP/CH24/player.h:134: error: `BOOL' does not name a type
    ../VCOOP/CH24/player.h: In constructor `CPlayer::CPlayer()':
    ../VCOOP/CH24/player.h:123: error: `m_modTime' undeclared (first use this function)
    ../VCOOP/CH24/player.h:123: error: `CTime' has not been declared
    ../VCOOP/CH24/player.h:123: error: `GetCurrentTime' undeclared (first use this function)
    ../VCOOP/CH24/player.h: In constructor `CWizard::CWizard(int, CString)':
    ../VCOOP/CH24/player.h:162: error: `mag' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:163: error: invalid use of undefined type `struct CString'
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:163: error:   initializing argument 1 of `void CCharacter::SetMagic(CString)'
    ../VCOOP/CH24/player.h: In constructor `CWizard::CWizard(int, CString)':
    ../VCOOP/CH24/player.h:162: error: `mag' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h: In constructor `CWizard::CWizard(int, CString)':
    ../VCOOP/CH24/player.h:162: error: `mag' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h: In constructor `CPriest::CPriest(int, CString)':
    ../VCOOP/CH24/player.h:172: error: `mag' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:173: error: invalid use of undefined type `struct CString'
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h:173: error:   initializing argument 1 of `void CCharacter::SetMagic(CString)'
    ../VCOOP/CH24/player.h: In constructor `CPriest::CPriest(int, CString)':
    ../VCOOP/CH24/player.h:172: error: `mag' has incomplete type
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/player.h: In constructor `CPriest::CPriest(int, CString)':
    ../VCOOP/CH24/player.h:172: error: `mag' has incomplete type
    
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    In file included from ../VCOOP/CH24/zalthdoc.h:11,
                     from ../VCOOP/CH24/charlist.h:7,
                     from ../VCOOP/CH24/charlist.cpp:6:
    ../VCOOP/CH24/linklist.h: At global scope:
    ../VCOOP/CH24/linklist.h:12: error: expected class-name before '{' token
    ../VCOOP/CH24/linklist.h:14: error: ISO C++ forbids declaration of `DECLARE_SERIAL' with no type
    ../VCOOP/CH24/linklist.h:14: error: expected `;' before "protected"
    ../VCOOP/CH24/linklist.h:25: error: variable or field `SetDirty' declared void
    ../VCOOP/CH24/linklist.h:25: error: expected `;' before '(' token
    ../VCOOP/CH24/linklist.h:29: error: expected `;' before "BOOL"
    ../VCOOP/CH24/linklist.h:29: error: `BOOL' does not name a type
    ../VCOOP/CH24/linklist.h: In constructor `CPlayerList::CPlayerList()':
    
    ../VCOOP/CH24/linklist.h:19: error: `m_bIsDirty' undeclared (first use this function)
    ../VCOOP/CH24/linklist.h:19: error: `FALSE' undeclared (first use this function)
    In file included from ../VCOOP/CH24/charlist.h:7,
                     from ../VCOOP/CH24/charlist.cpp:6:
    ../VCOOP/CH24/zalthdoc.h: At global scope:
    ../VCOOP/CH24/zalthdoc.h:15: error: expected class-name before '{' token
    ../VCOOP/CH24/zalthdoc.h:21: error: ISO C++ forbids declaration of `DECLARE_DYNCREATE' with no type
    ../VCOOP/CH24/zalthdoc.h:21: error: expected `;' before "private"
    ../VCOOP/CH24/zalthdoc.h:23: error: `BOOL' does not name a type
    
    ../VCOOP/CH24/zalthdoc.h:24: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthdoc.h:29: error: ISO C++ forbids declaration of `CBitmap' with no type
    ../VCOOP/CH24/zalthdoc.h:29: error: expected `;' before '*' token
    ../VCOOP/CH24/zalthdoc.h:30: error: ISO C++ forbids declaration of `CBitmap' with no type
    ../VCOOP/CH24/zalthdoc.h:30: error: expected `;' before '*' token
    ../VCOOP/CH24/zalthdoc.h:56: error: variable or field `SetStartPoint' declared void
    ../VCOOP/CH24/zalthdoc.h:56: error: expected `;' before '(' token
    ../VCOOP/CH24/zalthdoc.h:63: error: variable or field `DrawImage' declared void
    ../VCOOP/CH24/zalthdoc.h:63: error: expected `;' before '(' token
    ../VCOOP/CH24/zalthdoc.h:64: error: variable or field `DrawPlayer' declared void
    ../VCOOP/CH24/zalthdoc.h:64: error: expected `;' before '(' token
    ../VCOOP/CH24/zalthdoc.h:65: error: variable or field `DrawBackdrop' declared void
    ../VCOOP/CH24/zalthdoc.h:65: error: expected `;' before '(' token
    ../VCOOP/CH24/zalthdoc.h:74: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthdoc.h:75: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthdoc.h:87: error: ISO C++ forbids declaration of `DECLARE_MESSAGE_MAP' with no type
    ../VCOOP/CH24/zalthdoc.h:87: error: expected `;' before "private"
    ../VCOOP/CH24/zalthdoc.h:89: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthdoc.h:93: error: field `m_szFileName' has incomplete type
    
    ../VCOOP/CH24/zalthdoc.h:94: error: field `m_szFileTitle' has incomplete type
    ../VCOOP/CH24/zalthdoc.h:98: error: `BOOL' does not name a type
    
    ../VCOOP/CH24/zalthdoc.h:102: error: variable or field `Serialize' declared void
    ../VCOOP/CH24/zalthdoc.h:102: error: expected `;' before '(' token
    ../VCOOP/CH24/zalthdoc.h:103: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthdoc.h:104: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthdoc.h:105: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthdoc.h:112: error: `BOOL' does not name a type
    ../VCOOP/CH24/zalthdoc.h:116: error: `BOOL' does not name a type
    
    In file included from ../VCOOP/CH24/charlist.h:7,
                     from ../VCOOP/CH24/charlist.cpp:6:
    ../VCOOP/CH24/zalthdoc.h:123:23: warning: no newline at end of file
    In file included from ../VCOOP/CH24/charlist.cpp:6:
    ../VCOOP/CH24/charlist.h:10: error: expected class-name before '{' token
    ../VCOOP/CH24/charlist.h:14: error: `CListBox' does not name a type
    ../VCOOP/CH24/charlist.h:16: error: `CWnd' has not been declared
    ../VCOOP/CH24/charlist.h:16: error: ISO C++ forbids declaration of `pParent' with no type
    ../VCOOP/CH24/charlist.h:17: error: `BOOL' does not name a type
    ../VCOOP/CH24/charlist.h:27: error: variable or field `DoDataExchange' declared void
    ../VCOOP/CH24/charlist.h:27: error: `DoDataExchange' declared as a `virtual' field
    ../VCOOP/CH24/charlist.h:27: error: expected `;' before '(' token
    ../VCOOP/CH24/charlist.h:34: error: ISO C++ forbids declaration of `DECLARE_MESSAGE_MAP' with no type
    ../VCOOP/CH24/charlist.h:34: error: expected `;' before '}' token
    ../VCOOP/CH24/charlist.h:34: error: expected `;' before '}' token
    ../VCOOP/CH24/charlist.cpp:18: error: `CWnd' has not been declared
    ../VCOOP/CH24/charlist.cpp:19: error: ISO C++ forbids declaration of `pParent' with no type
    ../VCOOP/CH24/charlist.cpp: In constructor `CCharList::CCharList(CZaltharDoc*, int*)':
    ../VCOOP/CH24/charlist.cpp:19: error: class `CCharList' does not have any field named `CDialog'
    ../VCOOP/CH24/charlist.cpp: At global scope:
    ../VCOOP/CH24/charlist.cpp:29: error: ISO C++ forbids declaration of `OnInitDialog' with no type
    ../VCOOP/CH24/charlist.cpp:29: error: no `int CCharList::OnInitDialog()' member function declared in class `CCharList'
    ../VCOOP/CH24/charlist.cpp: In member function `int CCharList::OnInitDialog()':
    ../VCOOP/CH24/charlist.cpp:30: error: `RECT' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:30: error: expected `;' before "listRect"
    ../VCOOP/CH24/charlist.cpp:31: error: `rectPtr' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:31: error: `listRect' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:33: error: `m_charList' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:33: error: `LBS_SORT' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:33: error: `LBS_HASSTRINGS' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:34: error: `WS_CHILD' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:34: error: `WS_VISIBLE' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:34: error: `WS_VSCROLL' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:35: error: `WS_TABSTOP' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:38: error: `ASSERT_VALID' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp:42: error: invalid use of undefined type `struct CString'
    ../VCOOP/CH24/player.h:43: error: forward declaration of `struct CString'
    ../VCOOP/CH24/charlist.cpp:44: error: `FALSE' undeclared (first use this function)
    ../VCOOP/CH24/charlist.cpp: At global scope:
    ../VCOOP/CH24/charlist.cpp:47: error: variable or field `DoDataExchange' declared void
    ../VCOOP/CH24/charlist.cpp:47: error: `int CCharList::DoDataExchange' is not a static member of `class CCharList'
    ../VCOOP/CH24/charlist.cpp:47: error: `CDataExchange' was not declared in this scope
    
    ../VCOOP/CH24/charlist.cpp:47: error: `pDX' was not declared in this scope
    ../VCOOP/CH24/charlist.cpp:48: error: expected `,' or `;' before '{' token
    ../VCOOP/CH24/charlist.cpp:55: error: `CDialog' has not been declared
    ../VCOOP/CH24/charlist.cpp:59: error: expected constructor, destructor, or type conversion before "END_MESSAGE_MAP"
    ../VCOOP/CH24/charlist.cpp:59: error: expected `,' or `;' before "END_MESSAGE_MAP"
    
    make.exe: *** [../VCOOP/CH24/charlist.o] Error 1
    
    Execution terminated

  4. #4
    Banned
    Join Date
    Jun 2005
    Posts
    594
    yea your error are because it cant find several header
    files need for some of the functions.

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    The book is about Visual C++, but you are using Dev-C++. These are two different IDE's. You should use Visual C++ if possible since that is the IDE that the book was intended for.

    If you cannot, then it might be possible to make the code work in Dev-C++ on Windows, but you'll have to make a few (or a lot of) changes. I'm not familiar enough with either the code or the IDE to help further.

  6. #6
    Registered User
    Join Date
    Jul 2005
    Posts
    22

    Thumbs down

    I have tried on Visual C++ and Dev, both get alot of errors. The book uses a older visual c++, i guess thats the problem with that.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    It's an inherent problem of choosing books which mention a specific compiler in the title, because invariably the code is written for that compiler rather than with reference to the language standards.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Cat Lover
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    109
    ../VCOOP/CH24/stdafx.h:6:58: afxwin.h: No such file or directory
    ../VCOOP/CH24/stdafx.h:7:55: afxext.h: No such file or directory
    There's your two missing files, afxwin.h and afxext.h.


    Perhaps you could google them, they might be available for download somewhere?

  9. #9
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    It looks like the project was done in MFC. You'll either need VC++ compiler or a compiler that has this library. Maybe the book came with a learner edition you could try.

  10. #10
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    I have tried on Visual C++ and Dev, both get alot of errors. The book uses a older visual c++, i guess thats the problem with that.
    Maybe some of the errors are easy to fix. Can you also give the errors when you compile with Visual C++?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem Compiling Program
    By wco5002 in forum C++ Programming
    Replies: 13
    Last Post: 11-06-2007, 12:56 PM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  3. Functions in C
    By shoobsie in forum C Programming
    Replies: 15
    Last Post: 11-17-2005, 01:47 PM
  4. Deleting object after list removal (C++ visual studio)
    By RancidWannaRiot in forum Windows Programming
    Replies: 2
    Last Post: 10-20-2005, 06:06 PM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM