Hi
I have below project directories
Project Folder
-components
--sensors
---sensor.c
---component.mk
---include
----sensor.h
-main
--main.c
--component.mk
-Makefile
-sdkconfig
My component.mk file in sensor folder contents are like this
COMPONENT_ADD_INCLUDEDIRS := include
I included the header file sensor.h in main.c
The component got successfully and .a static library got generated in build/sensors directory but the functions didn't get linked to the main application and i am receiving undefined reference to errors.
Could you help on this.
Thanks,
Karim
New Component creation for project
-
- Posts: 9725
- Joined: Thu Nov 26, 2015 4:08 am
Re: New Component creation for project
Your setup looks correct, no reason for linking errors to appear. Are you sure it's the problem of the component infrastructure, and not something else? Have you tried running 'make clean' as well?
Re: New Component creation for project
Yes,
Make clean also didn't work.
For sensor header file i receive the warning: 'i2c_master_init' used but never defined
For the sensor c source file i receive the warning: 'i2c_master_init' defined but not used [-Wunused-function]
and for main.c i receive error: undefined reference to `i2c_master_init'
Do I need make any changes to the Makefile/ component.mk of main folder to include the sensor static library/component or will it automatically handled ?
Make clean also didn't work.
For sensor header file i receive the warning: 'i2c_master_init' used but never defined
For the sensor c source file i receive the warning: 'i2c_master_init' defined but not used [-Wunused-function]
and for main.c i receive error: undefined reference to `i2c_master_init'
Do I need make any changes to the Makefile/ component.mk of main folder to include the sensor static library/component or will it automatically handled ?
-
- Posts: 9725
- Joined: Thu Nov 26, 2015 4:08 am
Re: New Component creation for project
Any chance you can put the log saying that and/or the entire project somewhere, so we can take a look?
Re: New Component creation for project
PFA, log and Makefile .
Its basically the blink example where i added the component
Its basically the blink example where i added the component
- Attachments
-
- blink.zip
- (6.29 KiB) Downloaded 382 times
Who is online
Users browsing this forum: Majestic-12 [Bot] and 139 guests