This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to use lwip_gethostbyname(string) function.

Other Parts Discussed in Thread: LM3S6432

I see that netdb.h has lwip_gethostbyname(string) function is defined. I am trying to use it in a test program.

I have defined the include in my program for netdb.h. But Linker keeps failing. Any pointers ??

TIA

Dexthor.

  • Is the function lwip_gethostbyname actually defined in the header file (ie the body for the function exists in the header file) or is the definition in a source file? If so, that source file (or a library including that source) should be included in the build.

    Also, in future, it would be very helpful if you could include details such as version of compiler tools, device you are building for and exact error messages or screenshots.

  • Thanks Aarati,

    I am able to compile and link the binary  after getting the build paths right. Now it fails during Linkage.

    "../lm3s6432.cmd", line 41: error: run placement fails for object ".bss", size
       0x8480 (page 0).  Available ranges:
       SRAM         size: 0x8000       unused: 0x7e93       max hole: 0x7e93   
    error: errors encountered during linking; "s2e.out" not built

    My target platform is LM3S6432. I tried O3 compiler optimization level, but its not making much difference.

    -GM.

     

  • This error is basically saying that the section you are trying to allocate to SRAM (in this case .bss) is too large to fit into the available memory range. The .bss section is for uninitialized global and static variables in your program. According to the message, the size of this section for your application is 0x8480 but SRAM only has a total memory of 0x8000 available.

    You can see from the linker command file lm3s6432.cmd that in addition to .bss a few other sections are allocated to SRAM as well. You need to ensure that the sum of all those sections fits into the available SRAM. The link map file generated as part of the build (.map) should give details on the different sections and their sizes. If the sections do not fit, you would need to either modify your app to reduce the amount of  uninitialized data or move to another device with more memory.