views:

496

answers:

2

When I compile a project I get this error:

C:\DATOSA~1\FAXENG~1>nmake /f Makefile.vc clean

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

    cd src
    nmake /nologo /f Makefile.vc clean
    del /F *.obj *.lib *.dll *.exe *.res *.exp
    cd..
    cd tools
    nmake /nologo /f Makefile.vc clean
    del *.obj *.lib *.dll *.exe
    No se encuentra C:\DATOSA~1\FAXENG~1\tools\*.obj
    cd ..

C:\DATOSA~1\FAXENG~1>nmake /f Makefile.vc

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

    cd src
    nmake /nologo /f Makefile.vc
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c ClassOne.cpp ClassOne.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c ClassOnePointZero. ClassOnePointZero.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c ClassTwo.cpp ClassTwo.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c ClassTwoPointOne.c ClassTwoPointOne.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c ClassTwoPointZero. ClassTwoPointZero.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c ClassZero.cpp ClassZero.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c CommPort.cpp CommPort.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c ECMBuffer.cpp ECMBuffer.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c excepthandler.cpp excepthandler.cpp
    cl /nologo /MT /W3 /EHsc /O2 /I "..\..\tiff-3.8.2\libtiff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c FaxAPI.cpp FaxAPI.cpp
    FaxAPI.cpp(143) : error C2061: syntax error : identifier 'CClassZero'
    NMAKE : fatal error U1077: '"c:\Archivos de programa\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2' Stop.
    NMAKE : fatal error U1077: '"c:\Archivos de programa\Microsoft Visual Studio 9.0\VC\BIN\nmake.EXE"' : return code '0x2' Stop.

The only thing I did was copy and paste ClassTwoPointOne files into ClassZero files and change names...

ClassTwoPointOne.h:

#ifndef CLASSTWOPOINTONE_H
#define CLASSTWOPOINTONE_H

#include "ClassTwoPointZero.h"

class CClassTwoPointOne : public CClassTwoPointZero
{
public:
    CClassTwoPointOne();
    virtual ~CClassTwoPointOne();

    virtual void SetFClass(void);
};

#endif // CLASSTWOPOINTONE_H

ClassTwoPointOne.cpp:

#include "stdafx.h"
#include "ClassTwoPointOne.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CClassTwoPointOne::CClassTwoPointOne()
{
    m_sEIAClass = "2.1";
    m_nScanTime = 0;
}

CClassTwoPointOne::~CClassTwoPointOne()
{

}

void CClassTwoPointOne::SetFClass(void)
{
    SendCommand( COMMAND_SET_FCLASS_2_1);
}

ClassZero.h:

#ifndef CLASSZERO_H
#define CLASSZERO_H

#include "VoiceModem.h"

class CClassZero : public CVoiceModem
{
public:
    CClassZero();
    virtual ~CClassZero();
};

#endif // CLASSZERO_H

ClassZero.cpp:

#include "stdafx.h"
#include "ClassZero.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CClassZero::CClassZero()
{
}

CClassZero::~CClassZero()
{
}

I don't understand whats wrong... anyone can help?

Thanks a lot

+3  A: 

FaxAPI.cpp(143) : error C2061: syntax error : identifier 'CClassZero'

The error is at or near line number 143, in file FaxAPI.cpp. The error is related to the identifier CClassZero

(Possibly being undefined, or misused. Possibly something as mundane as a missing semicolon).

If you cannot find the error in FaxAPI.cpp yourself, you need to provide us with the relevant part of that file.

abelenky
There was an include missing... line 143 was: case FAXAPI_CLASS_0:pMdm = new CClassZero;break;Thanks for pointing out that something could be missing from or undefined. I was convinced the code from this file was ok.
deb
+1  A: 

msdn says c2061: "The compiler found an identifier where it wasn't expected. Make sure that identifier is declared before you use it." So apparently class CClassZero became undeclared after you messed with the files, makesure that you include appropriate files and that they contain a valid declaration of class CClassZero

justadreamer