Thread: help with project using classes

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    27

    help with project using classes

    Here are my errors:

    --------------------Configuration: project 6 - Win32 Debug--------------------
    Compiling...
    project 6.cpp
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(89) : error C2451: conditional expression of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' is illegal
    No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(98) : error C2451: conditional expression of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' is illegal
    No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(107) : error C2451: conditional expression of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' is illegal
    No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(117) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion)
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(159) : error C2511: 'getEnvelope' : overloaded member function 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (void)' not found in
    'Contacts'
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(15) : see declaration of 'Contacts'
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(169) : error C2511: 'getEmail' : overloaded member function 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (void)' not found in 'Co
    ntacts'
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(15) : see declaration of 'Contacts'
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(172) : error C2511: 'getPhone' : overloaded member function 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (void)' not found in 'Co
    ntacts'
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(15) : see declaration of 'Contacts'
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(180) : error C2065: 'item' : undeclared identifier
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(180) : error C2065: 'count' : undeclared identifier
    C:\Program Files\Microsoft Visual Studio\MyProjects\project 6\project 6.cpp(183) : error C2065: 'phone' : undeclared identifier
    Error executing cl.exe.

    project 6.exe - 10 error(s), 0 warning(s)

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    27

    updated code--if anyone can help

    I've worked alot of this out now.

    Any more help from anyone?

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    compiles fine...besides a shady few having to enter things twice (ie a command), and skipping over some things when enterting the info, works fine.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    27

    reallY?

    doesn't compile for me

    ERRORS:

    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    Debug/project 6.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

  5. #5
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    what compiler are you using ?

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    27

    compiler

    visual C++

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    27

    running

    you got it to run ok? (other than what you stated)

  8. #8
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361

    Re: compiler

    Originally posted by DoItAllMom115
    visual C++
    I think the best thing for you to do is add this line to your main source file, just below your includes:
    #pragma comment(linker, "/subsystem:console")
    [needless explanation]You must have selected "Win32 Application" when creating your project. As you probably already know, console applications begin execution at main(), however, Windows applications begin execution at WinMain(). By selecting Win32 Application and using main() as opposed to WinMain(), the linker generates an error pertaining to the non-existant entry function. You can explictly tell the linker which type of application you're creating (console or Win32) by specifying either "/subsystem:windows" or "/subsystem:console" in your Project options (under the link tab).[/needless explanation]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Open-source Game Project
    By Glorfindel in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 03-24-2009, 01:12 AM
  2. College Classes
    By nubby in forum C Programming
    Replies: 2
    Last Post: 10-07-2007, 12:32 AM
  3. Remove ActiveX from VC++ project
    By cr_naik in forum Windows Programming
    Replies: 2
    Last Post: 07-02-2003, 11:15 AM
  4. Browse the classes on my project
    By eglinsky in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-30-2001, 05:41 PM