Error compiling PIC24 source

General questions about Firewing...

Error compiling PIC24 source

Postby Coccoliso » Fri Nov 28, 2014 1:06 pm

Hello David,
when I use compilers Swordfish / Firewing8 no error is generated,
only when compile with Firewing16 this error is raised (during linking I think ) :
Code: Select all
[ERROR]: ERROR - One or more errors have been reported during linking, build sourcefile in MPLAB to identify cause(Test-KO.c)

.. if you want I'll send you the source.
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: Error compiling PIC24 source

Postby David John Barker » Fri Nov 28, 2014 1:11 pm

Yes, just send me the source and I will look into it - sounds like a linker problem. Make sure you strip your program down to the smallest size that still generates the error. Thanks...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: Error compiling PIC24 source

Postby Coccoliso » Fri Nov 28, 2014 1:23 pm

Reading LST I was able to extrapolate the routine that generates the error that is declared as non-existent.

Code: Select all
Public Sub CArrCpy(ByRef dest() As Byte, ByRefConst sour() As Byte, len As Byte)
    While len<>0
        len -= 1
        dest(len) = sour(len)
    End While
End Sub

const b(3) as byte = {0,0,0}

Sub Main()
   dim a(3) as byte
   a(0)=0
   a(1)=0
   a(2)=0   
   CArrCpy(a,b,2)
End Sub
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: Error compiling PIC24 source

Postby David John Barker » Fri Nov 28, 2014 2:08 pm

Yes, I see the problem - thanks for the code, I will look into it. In the meantime, if assigning a constant array to an array, just use
Code: Select all
a = b

alternatively, store the const in a local variable. For example,
Code: Select all
    Public Sub CArrCpy(ByRef dest() As byte, ByRefConst sour() As byte, len As Byte)
        While len<>0
            len -= 1 
            dim destVar as byte = sour(len)
            dest(len) = destVar
        End While
    End Sub
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: Error compiling PIC24 source

Postby Coccoliso » Fri Nov 28, 2014 2:17 pm

Ok David.
Thanks.
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: Error compiling PIC24 source

Postby David John Barker » Fri Nov 28, 2014 4:06 pm

You can now download the latest BETA which should fix the problem for you

http://www.firewing.info/pmwiki.php?n=Firewing.Download
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: Error compiling PIC24 source

Postby Coccoliso » Fri Nov 28, 2014 6:01 pm

Hello David,
ConstByRef Arrays is OK :D
I had another strange problem on strings chains reduced in this example.

Code: Select all
#option MAKE_IT_COMPILABLE = False

dim s as string = ""
private sub Test(sIn as string)
   s = s + sIn   
end sub

Sub Main()
#if MAKE_IT_COMPILABLE
    Test("<form name=")
    Test(cchar(34) & "myform" & cchar(34))
#else
    Test("<form name=" & cchar(34) & "myform" & cchar(34))
#endif   
End Sub
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: Error compiling PIC24 source

Postby David John Barker » Fri Nov 28, 2014 6:36 pm

I've uploaded a new BETA (B2) which should fix the problem...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: Error compiling PIC24 source

Postby Coccoliso » Fri Nov 28, 2014 7:56 pm

Remains only two lines without terminator due to the chain of the string with double CR+LF.
I recompiled C source generated by FW and remains only two lines causing missing references like "'_DB_StrConst_xx' undeclared ".
Code that reproduces the problem :
Code: Select all
#option MAKE_IT_COMPILABLE = False

dim s as string(80) = ""
private sub Test(sIn as string)
   s = s + sIn   
end sub

Sub Main()
#if MAKE_IT_COMPILABLE
    Test("Content-Type: text/html")
    Test(cchar(13))
    test(cchar(10))
    test(cchar(13))
    test(cchar(10))
#else
    Test("Content-Type: text/html" & cchar(13) & cchar(10) & cchar(13) & cchar(10))
#endif   
End Sub
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: Error compiling PIC24 source

Postby David John Barker » Fri Nov 28, 2014 8:40 pm

OK, it all releated to the same problem - handling escape chars. Try the latest BETA (B3)

http://www.firewing.info/pmwiki.php?n=Firewing.Download

and let me know if it fixes the problem for you...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Next

Return to Questions

Who is online

Users browsing this forum: No registered users and 1 guest

x