Thread: Code won't compile

  1. #1
    Registered User
    Join Date
    May 2009

    Code won't compile

    Hey guys,

    I'm a total beginner when it comes to this stuff. I was given code for a project I'm doing but for some reason it won't compile for me but it compiled for the person that gave it to me. I'm using MPLAB and I get an error message saying 'can't generate code for this expression" and this is the line of code it points to

     if (RA1 ==1 & dutycycle >0)
    I was reading up on it and I think it may have something to do with this line being too complicated for the code generator to compile but iI have no idea how to simplify it.

    Any help is greatly appreciated.

    Thanks guys

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    Try using && instead of &.

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    May 2009
    Thanks for replying so quickly. It didn't like that at all at all!!!

    Error [1347] ; 0. can't find 0x70 words (0x70 withtotal) for psect "text80" in segment "CODE" (largest unused contiguous range 0x4A)

  4. #4
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    New Zealand
    if (RA1 == 1 && dutycycle > 0)
    is a well-formed C statement, providing RA1 and dutycycle are either variables or constants. So it should be fine if MPLAB uses the C language.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile Errors in my Code. Can anyone help?
    By DGLaurynP in forum C Programming
    Replies: 1
    Last Post: 10-06-2008, 09:36 AM
  2. This code won't compile in Red Hat Linux 9
    By array in forum Linux Programming
    Replies: 7
    Last Post: 04-27-2004, 06:30 AM
  3. ....this code doesn't compile, very odd error
    By Leeman_s in forum Windows Programming
    Replies: 2
    Last Post: 11-03-2002, 02:31 PM
  4. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Linux Programming
    Replies: 0
    Last Post: 10-14-2002, 01:30 PM
  5. How do they compile code for an OS ?
    By Nutshell in forum A Brief History of
    Replies: 49
    Last Post: 03-28-2002, 12:16 AM