×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    36

    Code does not compile anymore, has been working since the 9210 communicator

    This is the code

    Code:
    #include <e32base.h>
    
    // gdi
    #include <gdi.h>
    
    /**
     * TGDIRgb 
     *
     *  This class can store negative color values as well (for errors )
     */
    class TGDIRgb
    {
    public:
        TGDIRgb(): iR(0), iG(0), iB(0) {}
        TGDIRgb(TInt aRed, TInt aGreen, TInt aBlue): iR(aRed), iG(aGreen), iB(aBlue) {}
    
        TInt Red() const { return iR; }
        TInt Green() const { return iG; }
        TInt Blue() const { return iB; }
    
        void SetRed  (TInt aRed)   { iR = aRed; }
        void SetGreen(TInt aGreen) { iG = aGreen; }
        void SetBlue (TInt aBlue)  { iB = aBlue; }
    
    // first error line
        TRgb Rgb() const { return TRgb(iR < 0 ? 0 : iR > 255 ? 255: iR, 
                                              iG < 0 ? 0 : iG > 255 ? 255: iG,
                                              iB < 0 ? 0 : iB > 255 ? 255: iB); }
      
        void SetRgb(const TRgb& aRgb) { iR = aRgb.Red(); iG = aRgb.Green(); iB = aRgb.Blue(); }
    
        TGDIRgb& operator +=(TGDIRgb aColor) { iR += aColor.iR; iG += aColor.iG; iB += aColor.iB; return *this; };
      
        TGDIRgb& operator /=(int aVal) { iR /= aVal; iG /= aVal; iB /= aVal; return *this; };
    
        friend TGDIRgb operator + (const TGDIRgb& aColor1, const TGDIRgb& aColor2);
      
        friend TGDIRgb operator / (const TGDIRgb& aColor1, TInt aVal);
    
    private:
        TInt iR; // red
        TInt iG; // green
        TInt iB; // blue
    };
    and these are the errors generated

    ..\view\DisplayMode.h:35: undefined identifier 'TRgb'
    ..\view\DisplayMode.h:35: (included from:
    ..\view\DisplayMode.h:35: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:35: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:35: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)
    ..\view\DisplayMode.h:37: ';' expected
    ..\view\DisplayMode.h:37: (included from:
    ..\view\DisplayMode.h:37: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:37: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:37: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)
    ..\view\DisplayMode.h:41: ';' expected
    ..\view\DisplayMode.h:41: (included from:
    ..\view\DisplayMode.h:41: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:41: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:41: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)
    ..\view\DisplayMode.h:43: undefined identifier 'TGDIRgb'
    ..\view\DisplayMode.h:43: (included from:
    ..\view\DisplayMode.h:43: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:43: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:43: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)
    ..\view\DisplayMode.h:45: illegal 'friend' declaration
    ..\view\DisplayMode.h:45: (included from:
    ..\view\DisplayMode.h:45: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:45: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:45: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)
    ..\view\DisplayMode.h:47: illegal 'friend' declaration
    ..\view\DisplayMode.h:47: (included from:
    ..\view\DisplayMode.h:47: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:47: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:47: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)
    ..\view\DisplayMode.h:49: declaration syntax error
    ..\view\DisplayMode.h:49: (included from:
    ..\view\DisplayMode.h:49: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:49: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:49: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)
    ..\view\DisplayMode.h:53: declaration syntax error
    ..\view\DisplayMode.h:53: (included from:
    ..\view\DisplayMode.h:53: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:53: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:53: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)
    ..\view\DisplayMode.h:56: warning: implicit 'int' is no longer supported in C++
    ..\view\DisplayMode.h:56: warning: (included from:
    ..\view\DisplayMode.h:56: warning: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\gdi.h:22
    ..\view\DisplayMode.h:56: warning: C:\Symbian\3\Nokia_Symbian3_SDK_v0.9\epoc32\include\mw\eikedwin.h:23
    ..\view\DisplayMode.h:56: warning: C:\Users\svdwal\projects\PdfPlus_S60\PdfPlusUiLib\model\SearchState.cpp:19)

    It appears that TRgb is not recognized, even though gdi.h is clearly included by the header file.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Code does not compile anymore, has been working since the 9210 communicator

    Quote Originally Posted by sevdwal View Post
    It appears that TRgb is not recognized, even though gdi.h is clearly included by the header file.
    That is just a header file, the compiler obviously needs the declaration. You should check if gdi.h still contains it, and if not, check where it has been moved to.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    36

    Re: Code does not compile anymore, has been working since the 9210 communicator

    The problem is not that TRgb has been removed from gdi.h. That would have been a mayor compatibility problem, with no UI code compiling.

    The problem is different, Symbian^3 has introduced new header files and one of those filenames was on that I had been using since the last 9 years. This is a defect in Symbian^3 and I have reported it as such to the Symbian Foundation.

    A tip therefore for other people, if you get weird compiler errors, check whether your include filenames are not in use with Symbian^3.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Code does not compile anymore, has been working since the 9210 communicator

    Do not be too surprised if SF/FN will not treat it as a defect. File name clashes exist, and that is all.
    Quote Originally Posted by DisplayMode.h
    // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
    suggests that the file is part of the Symbian/S60 code from the very beginning, just it was not present in the SDK-s until now.

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    36

    Re: Code does not compile anymore, has been working since the 9210 communicator

    Sigh. If Nokia/Symbian wants to have more developers developers developers then they should continue to treat them as if they don't matter (keeping it polite). That really works.

    There are lots of old Symbian include files that use some kind of prefix, like coe... or eik... or e32... or akn... So there are (were?) at least some people that knew what they were doing. No reason why the same kind of prefixes cannot be used for internal include files that are not part of the public interface.

Similar Threads

  1. Replies: 3
    Last Post: 2010-09-08, 00:02
  2. Pjava on the 9210 Communicator
    By quintel in forum PersonalJava
    Replies: 0
    Last Post: 2004-06-16, 08:27
  3. 9210 communicator
    By judahb in forum General Development Questions
    Replies: 2
    Last Post: 2003-12-30, 15:50
  4. Bluetooth connnection not working anymore
    By aeyre in forum Bluetooth Technology
    Replies: 0
    Last Post: 2003-10-13, 11:09
  5. Replies: 0
    Last Post: 2002-10-09, 06:58

Posting Permissions

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