AR# 58295

14.7 SDK - An error occurs when attempting to add a user library to the build

描述

I want to use custom libraries in my application, however, when I add a user library (mylib) to the build under Properties > C/C++General > Paths and Symbols > Libraries, this results in an error similar to the following:

c:/xilinx/sdk/2013.2/gnu/arm/nt/bin/../lib/gcc/arm-xilinx-eabi/4.7.2/../../../../arm-xilinx-eabi/bin/ld.exe: cannot find -l-Wl,--start-group,-lmylib,-lxil,-lgcc,-lc,-lstdc++,--end-group
collect2.exe: error: ld returned 1 exit status
make: *** [app_xil_cpu0.elf] Error 1

How can I fix this problem?

解决方案

Adding the library path using the "Add Library" option in "Project Properties -> C/C++ General -> Paths And Symbols -> Libraries" is corrupting the makefile.

Any subsequent changes are effected by this change.

To work around this issue, create a new application and copy the sources from the old application. Then, apply the library settings for the new application by following these steps:

  1. Right-click on the application project.
  2. Go to C/C++ Build -> Settings.
  3. Select "Libraries" section under "Microblaze gcc linker"
  4. Press "Add" button and give the library name.
  5. Optionally, add the "Library Search Path", if your library is in different path.
AR# 58295
日期 11/08/2013
状态 Active
Type 综合文章
Tools