I am referring this xmos doc and try to build a test library and use it in an application.
The expected behavior is for the libraries defined in `MODULE_LIBRARIES` to be included during the build process, but this is not happening.
The file tree looks like this:
Code: Select all
sw_test
└── app_test_lib_module
├── Makefile
├── bin
└── src
└── main.xc
lib_rgb
├── api
│ └── misc_utils.h
├── lib
│ └── xs3a
│ └── librgb.a
└── module_build_info
Code: Select all
TARGET = XCORE-AI-EXPLORER
BUILD_FLAGS = -O2 -g -DDEBUG_PRINT_ENABLE=1 -report -fxscope
USED_MODULES = lib_rgb
MODULE_LIBRARIES = rgb
XCC_FLAGS = $(BUILD_FLAGS)
Code: Select all
$ xmake -j
Checking build modules
Using build modules: lib_rgb_copy(0.0.2)
Rebuild .build/_iflag.rsp
Analyzing main.xc
Rebuild .build/_pca.rsp
Propagating analysis
Creating dependencies for main.xc
Compiling main.xc
Rebuild .build/_obj.rsp
Creating app_test_lib_module.xe
../src/main.xc: Error: Undefined reference to 'reverse_buf'
xmake[1]: *** [bin//app_test_lib_module.xe] Error 1
xmake: *** [bin//app_test_lib_module.xe] Error 2
What I did was moving the header file and library to the app_test_lib/lib/, like this:
Code: Select all
lib
├── librgb.a
└── misc_utils.h
Code: Select all
BUILD_FLAGS += -L../lib -lrgb -I../lib