Thread: Am I stupid, or is it my compiler?

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937

    Am I stupid, or is it my compiler?

    What's wrong with this code? I DID declare the variable!


    --------------------Configuration: Password - Win32 Debug--------------------
    Compiling...
    PasswordChange.cpp
    C:\...\...\...etc...\PasswordChange.cpp(72) :
    error C2065: 'm_PASSWORD' : undeclared identifier
    Error executing cl.exe.

    Password.exe - 1 error(s), 0 warning(s)






    if(m_OldPassword.IsEmpty() == FALSE && m_NewPassword.IsEmpty() == FALSE)
    {
    if(!strcmp(m_PASSWORD,m_OldPassword))
    {
    MessageBox("Would you like some yams?");
    }
    }
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    is it declared as a global variable? if it isn't, is it in the same function? or maybe, is it in another file and you didn't make it an extern variable?

    if all this fails... it's the compiler.

    Oh, and, are you sure that the MessageBox function is OK?

    Oskilian

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    I bet my monthly paycheck that it's NOT the compiler. It's almost NEVER the compiler. Look out for typos and scopes.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937
    It's global. The MessageBox is preset, so it's ok. There are no typos. I can't figure it out!
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie Problem: Stupid Compiler Error
    By iSlak in forum C++ Programming
    Replies: 4
    Last Post: 08-22-2005, 05:34 AM
  2. Stupid compiler
    By chris1985 in forum C Programming
    Replies: 5
    Last Post: 07-01-2005, 07:22 AM
  3. Dev C++ Compiler, Indentation?
    By Zeusbwr in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 06:13 AM
  4. lcc win32 compiler download problems
    By GanglyLamb in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-01-2004, 07:39 PM
  5. Special Compiler for win app's
    By Unregistered in forum Windows Programming
    Replies: 19
    Last Post: 04-26-2002, 03:52 PM