CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2012
    Posts
    4

    error C2220: warning treated as error - no object file generated?

    I feel very stupid for asking but i am stuck on this error when trying to build this driver in win2kddk
    the error is as follows

    c:\WINDDK\tmp\btcap\BtDigitizer.cpp(454) : error C2220: warning treated as error - no object file generated
    c:\WINDDK\tmp\btcap\BtDigitizer.cpp(454) : warning C4018: '<' : signed/unsigned mismatch
    c:\WINDDK\tmp\btcap\BtDigitizer.cpp(469) : warning C4018: '<' : signed/unsigned mismatch
    c:\WINDDK\tmp\btcap\BtDigitizer.cpp(484) : warning C4018: '<' : signed/unsigned mismatch
    c:\WINDDK\tmp\btcap\BtDigitizer.cpp(499) : warning C4018: '<' : signed/unsigned mismatch
    c:\WINDDK\tmp\btcap\BtDigitizer.cpp(514) : warning C4018: '<' : signed/unsigned mismatch
    c:\WINDDK\tmp\btcap\BtDigitizer.cpp(529) : warning C4018: '<' : signed/unsigned mismatch
    c:\WINDDK\tmp\btcap\BtDigitizer.cpp(599) : warning C4018: '<' : signed/unsigned mismatch


    the set of code for line 454 is below

    // Second, the SVideo inputs if we have them.
    DWORD VideoInPin = Pin;
    DWORD Idx = GUID_INDEX;
    for (DWORD PinToDo = 0; Idx < GUID_COUNT && PinToDo < GetBtCard().SVideoInputCount(); PinToDo++) {
    BtXBar::InputPinInfo[Pin].Direction = KSPIN_DATAFLOW_IN;
    BtXBar::InputPinInfo[Pin].Conn = VideoConSVideo0 + PinToDo;
    BtXBar::InputPinInfo[Pin].PinType = KS_PhysConn_Video_SVideo;
    BtXBar::InputPinInfo[Pin].RelatedPinIndex = 0;/*the audio pin*/
    BtXBar::InputPinInfo[Pin].Medium.Set = STATIC_GUID[Idx];
    BtXBar::InputPinInfo[Pin].Medium.Id = Instance;
    BtXBar::InputPinInfo[Pin].Medium.Flags = 0;
    BtXBar::Mediums[Pin] = BtXBar::InputPinInfo[Pin].Medium;
    BtXBar::PinDirection[Pin] = FALSE;
    Idx++;
    Pin++;
    }


    If anything else is needed to make since of this error please let me know.

    Thanks,
    Yonu

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: error C2220: warning treated as error - no object file generated?

    First, see Compiler Error C2220
    After that, decide if you want to simply remove /WX compiler option or fix the warning cause.
    If you want to fix the warning (this one I recommend), take a look at Compiler Warning C4018
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  3. #3
    Join Date
    Feb 2012
    Posts
    4

    Re: error C2220: warning treated as error - no object file generated?

    thanks for the info however I have been building without /WX so not sure what to change as to fixing it I hate to say this as I am new to this but that doesn't make much sense to me.

    Sorry,
    yonu

  4. #4
    Join Date
    Feb 2012
    Posts
    4

    Re: error C2220: warning treated as error - no object file generated?

    can anyone advise me on how to resolve this? sorry just never worked with drivers before

  5. #5
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: error C2220: warning treated as error - no object file generated?

    There is not a matter of drivers development but a basic C/C++ mistake.
    I have already advise what to do in post #2.

    Isn't MSDN Library available for you?
    MSDN Library: Compiler Warning C4018
    Comparing a signed and unsigned number required the compiler to convert the signed value to unsigned.
    This warning may be fixed if you cast one of the two types when testing signed and unsigned types.
    Or you can to change types declared in your program in order to avoid signed/unsigned mismatch.

    Need more advices?
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  6. #6
    Join Date
    Feb 2012
    Posts
    4

    Re: error C2220: warning treated as error - no object file generated?

    yes I looked at what it said on msdn however that makes very little sense to me sorry I am not fluent in c or c++
    as to changing eh types I have no idea what to change them to

  7. #7
    Join Date
    Dec 2012
    Posts
    1

    Re: error C2220: warning treated as error - no object file generated?

    Hi, I've just had this error and felt dumb for asking too. My error was actually that I was declaring a variable that I wasn't using.

    This post helped track down my dumbness but I would like to add, the people who are answering questions, please note, those of us asking questions aren't as good as you lot and we wouldn't ask if we knew the answer. A little bit more patients might be nice?

    John

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured