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.

Linking NDK 2 libraries problem.

Other Parts Discussed in Thread: OMAPL138

Hello,

I'm working with C6748, NDK 2.20.06.35, BIOS 5.41.11.38, nsp_1_00_00_09.

I'm developing a network application using TCP/IP stack.

I have copied the following NDK libraries to my project:

os_bios5.lib

netctrl.lib

nettool.lib

stack.lib

hal_timer_bios5.lib

hal_userled_stub.lib

hal_eth_stub.lib

hal_ser_stub.lib

ti.drv.omapl138.a674

I try to compile, but get the following message:

 undefined        first referenced                                                  
symbol in file
--------- ----------------
_NIMUDeviceTable C:/TI/ndk_2_20_06_35/packages/ti/ndk/lib/C674/stack.lib<nimu.o674>


If I link these libraries via "Project->Properties->Build->C6000 Linker->File Search Path->Include library file or command file as input" 
everything works fine and the project compiles successfully.
  1. Am I missing some other reference to the NDK?
  2. Is there any difference in the project build between actually copying required NDK libraries to the project and linking them from outside?
  3. How can I solve this problem without linking to the libraries?
Thank you, Anatoly.
  • Hi Anatoly,

    That symbol comes out of the ti.drv.omapl138.a674 library.

    This may be due to a link ordering problem.  Do you have the "-x" linker option set in your project?

    Steve

  • Thank you, Steve.

    I have this option checked in my project, it says:

    Reread libraries; resolve backward references (--reread_libs, -x).

    Is this right?

    How can I solve mentioned problem anyway?

    Anatoly.

  • Ok, I thought the -x options was missing and might have been the solution ... yes you have the option right.

    Do you have the client example (unmodified, as it was shipped)?

    The best option is to compare the project settings of the client example to your project and ensure that they are the same.

    Steve

  • Hi, Steve.

    Thank you for the response.

    I have opened the client example and copied the libraries to it's folder.

    In the client example options I have added the path "${PROJECT_ROOT}" to the "Project->Properties->Build->C6000 Linker->File Search Path" with checked -x option.

    It drops the same error, mentioned above, as in my application project.

    If I add actual library path to the -l option it compiles fine in both client example and my application project.

    How can I solve it?

    Anatoly.

  • Anatoly,

    For any library which you wish to link with your application, you must use the -l option in your application's project settings so that the linker will know to link it.  If you have a library listed with the -l option, then you must ensure that the linker options have the path to the actual library in order to be able to find it.

    Note that the paths that you have put in the "-l <library>" option will be concatenated to the end of each path in the linker's file search path.

    So for example if you listed "-l ti/ndk/lib/c64plus/stk.lib" and your linker search path had "C:/; C:/foo; C:/ti/ndk_2.20.00.XX/packages" then the following places will be checked for the library to see if it exists:

    C:/ti/ndk/lib/c64plus/stk.lib

    C:/foo/ti/ndk/lib/c64plus/stk.lib

    C:/ti/ndk_2.20.00.XX/packages/ti/ndk/lib/c64plus/stk.lib   // <- this check would probably succeed.

    Steve

  • Is it legal to add a search path with -x option, but not specify the actual library with -l option?

    Anatoly.

  • Hi, thank you for the explanation.

    Is it legal to add a search path to the libraries with -x option without adding actual library with -l option?

    Anatoly

  • Hi Anatoly,

    The -x option is not used for adding search paths to the linker, it's used to re-read the libraries for back reference.  Running "lnk6x.exe -help" from the command line provides some info:

      --reread_libs,-x             Reread libraries; resolve backward references

    For search paths you want:

      -i,--search_path=dir         Add <dir> to library search path

    Steve