No circular references, but undeclared idenifier
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: No circular references, but undeclared idenifier

  1. #1
    Join Date
    Dec 2010
    Posts
    587

    No circular references, but undeclared idenifier

    Each of my header includes is protected by directives
    I think I don't have to include Boolean in my work space because it is already included
    in the external dependencies section. and the Boolean.h is in the include path.

    MachineShop, Boolean etc got undeclared identifier error
    Tried to comment out the directives, to no avail.
    Thanks
    Jack
    Code:
    /*
     * Copyright (C) 1994
     *
     * Department of Computing Science,
     * The University,
     * Newcastle upon Tyne,
     * UK.
     */
    
    #include <iostream>
    #include <string.h>
    
    
    
    #ifndef BOOLEAN_H_
    #  include "Boolean.h"
    #endif
    
    #ifndef PROCESS_H_
    #  include "Process.h"
    #endif
    
    #ifndef MACHINESHOP_H_
    #  include "MachineShop.h"
    #endif
    
    #include "stdafx.h"
    
    using namespace std;
    
    int main (int argc, char** argv)
    {
        Boolean isBreaks = FALSE;
        
        for (int i = 0; i < argc; i++)
        {
    	if (strcmp(argv[i], "-help") == 0)
    	{
    	    cout << "Usage: Main -breaks -help" << endl;
    	    return 0;
    	}
    	if (strcmp(argv[i], "-breaks") == 0)
    	    isBreaks = TRUE;
        }
    
        Thread::Initialize(); // Initialize the threads package.
    
        /*
         * We don't need to call Resource::ref on m as it is created on
         * the stack. However, it would not cause any problems to do so,
         * and if objects are passed by pointer we may not know that one
         * has not been created on the heap. So, whenever we have a pointer
         * we will always call ref and unref before use.
         */
    
        MachineShop m(isBreaks); // Start up the real main body of the simulation.
    
        m.Await();               // Suspend main's thread (NOTE: this MUST be done
                                 // by all applications.)
    
        m.Exit();                // Reactivate main thread and then exit
        
        return 0;
    }

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,279

    Re: No circular references, but undeclared idenifier

    Code:
    #include "stdafx.h"
    must be the first #include
    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2010
    Posts
    587

    Re: No circular references, but undeclared idenifier

    Magic!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center