Reports undefined although doesn't exist

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AS7 reports undefined reference to 'bvlc_send_pdu'. double clicking on the error takes me close to a line that has 'datalink_send_pdu'. I have searched the project and entire solution. 'bvlc_send_pdu' doesn't exist as code, just a comment line '//#define datalink_send_pdu bvlc_send_pdu'. I removed the comment line and the error still exists.

 

I probably shouldn't put this on the same thread but it also reports undefined reference to 'delay'. I double click on the error and it takes me to a line where there is a bracket '}', delay is nowhere near the line AS7 says the problem exists. 'delay' exists and I an still looking for the missing reference.

 

Thanks Sandy

Sandy
Steril-Aire

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Post the smallest complete test program that demonstrates the situation.  Tell AVR target, toolchain, version, and optimization settings.

 

As with the hint from the comment, sometimes a puzzling identifier may be made with a macro.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, I can't give you cut down working code. This is a project from Steve K that I have been working for longer than I care to say. Personally I don't fully understand the project. It was written untested for a different compiler. This is the 2nd project I have brought into AS7 from a different project.

 

Severity  Description                                                Source  File                                                                                                                                   Line  Column
Error       ld returned 1 exit status                             Build     collect2.exe                                                                                                                       0      0
Error       undefined reference to `bvlc_send_pdu'      Build     C:\my projects\Atmel Studio\7.0\GccApplication3\GccApplication3\BACNet-Handlers\noserv.c  79    1
Error       recipe for target 'GccApplication3.elf' failed  Build     C:\my projects\Atmel Studio\7.0\GccApplication3\GccApplication3\Debug\Makefile                 393   1
Error       undefined reference to `delay'                    Build     C:\my projects\Atmel Studio\7.0\GccApplication3\GccApplication3\ethernet\w5100.cpp           107  1

    

The error says "bvlc_send_pdu" but that is not the highlighted line.

    bytes_sent =
        datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
        pdu_len);
    if (bytes_sent > 0) {
#if PRINT_ENABLED
        fprintf(stderr, "Sent Reject!\n");
#endif
    } else {
#if PRINT_ENABLED
        fprintf(stderr, "Failed to Send Reject (%s)!\n", strerror(errno));
#endif
    }

    The compiler says "delay", but that is not the highlighted line.

void W5100Class::recv_data_processing(SOCKET s, uint8_t *data, uint16_t len, uint8_t peek)
{
  uint16_t ptr;
  ptr = readSnRX_RD(s);
  read_data(s, (uint8_t *)ptr, data, len);
  if (!peek)
  {
    ptr += len;
    writeSnRX_RD(s, ptr);
  }
}

Sorry, I am out of here for the day. If I can get something working, I will send an update but I am not sure how to cut this down into a small working code. Thanks and have a great weekend. Sandy

 

Sandy
Steril-Aire

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sandy K. wrote:
Sorry, I can't give you cut down working code.

I'm out.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sandy K. wrote:
 I can't give you cut down working code

makes it virtually impossible to debug.

 

Sandy K. wrote:
This is a project from Steve K

Who?

 

 

Severity  Description                                                Source  File                                                                                                                                   Line  Column
Error       ld returned 1 exit status                             Build     collect2.exe                                                                                                                       0      0
Error       undefined reference to `bvlc_send_pdu'      Build     C:\my projects\Atmel Studio\7.0\GccApplication3\GccApplication3\BACNet-Handlers\noserv.c  79    1
Error       recipe for target 'GccApplication3.elf' failed  Build     C:\my projects\Atmel Studio\7.0\GccApplication3\GccApplication3\Debug\Makefile                 393   1
Error       undefined reference to `delay'                    Build     C:\my projects\Atmel Studio\7.0\GccApplication3\GccApplication3\ethernet\w5100.cpp           107  1

That "problems" list is very badly mangled, and often obfuscates rather than helps.

 

Look at the actual build output instead.    

 

    The compiler says "delay", but that is not the highlighted line.

Does it?

 

Looks more like a Linker error to me ... ?

 

In which case, these often seem to point only to the function in which they were referenced - not the specific line.

 

Are any of those things macros that might include a "call" to delay?

 

Is there inlining going on ... ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Presumably the mention of w5100 suggests "Wiznet"? So does this code come from Wiznet? Can't you ask them about it? L